Exemplo n.º 1
0
 public ImageFragment Add(Bitmap imatge, PointZ localizacio)
 {
     if (localizacio == null)
     {
         throw new ArgumentNullException("Se necesita una localizacion");
     }
     return(Add(imatge, localizacio.X, localizacio.Y, localizacio.Z));
 }
Exemplo n.º 2
0
 public ImageFragment(Bitmap imagen, PointZ localizacion)
 {
     if (localizacion == null)
     {
         throw new ArgumentNullException("Necesita una localizacion!");
     }
     if (imagen == null)
     {
         throw new NullReferenceException("La imagen no puede ser null");
     }
     this.imagen = new ImageBase(imagen);
     Location    = localizacion;
 }
Exemplo n.º 3
0
        public ImageFragment Add(Bitmap imagen, int x = 0, int y = 0, int z = 0)
        {
            if (imagen == null)
            {
                throw new ArgumentNullException("Se necesita una imagen");
            }

            ImageFragment fragment = null;
            PointZ        location = new PointZ(x, y, z);

            fragment = new ImageFragment(imagen, location);
            fragments.Afegir(fragment);


            return(fragment);
        }
Exemplo n.º 4
0
        public ImageFragment Remove(PointZ localizacion)
        {
            if (localizacion == null)
            {
                throw new ArgumentNullException("Se necesita un punto para localizar el fragmento");
            }

            ImageFragment fragmentoQuitado = GetFragment(localizacion);

            if (fragmentoQuitado != null)
            {
                fragments.Elimina(fragmentoQuitado);
            }

            return(fragmentoQuitado);
        }
Exemplo n.º 5
0
        public Color GetColor(Point point)
        {
            System.Drawing.Color color;
            PointZ location = new PointZ(point, 0);

            if (colorLocatedByPointerList.ContainsKey(location))
            {
                color = colorLocatedByPointerList[location];
            }
            else
            {
                color = imagen.GetPixel(point.X, point.Y);
                colorLocatedByPointerList.Add(location, color);
                if (!pointLocatedByColorList.ContainsKey(color.ToArgb()))
                {
                    pointLocatedByColorList.Add(color.ToArgb(), point);
                }
            }
            return(color);
        }
Exemplo n.º 6
0
 public static byte[] GetBytes(PointZ point)
 {
     return(GetBytes(point.X).AddArray(GetBytes(point.Y), GetBytes(point.Z)));
 }
Exemplo n.º 7
0
 public ImageFragment[] GetFragments(PointZ location)
 {
     return(GetFragments(location.X, location.Y, location.Z));
 }