Пример #1
0
 public static IImage createImage(Stream stream)
 {
     NETImage lwuitImage = new NETImage();
     lwuitImage.image = new Bitmap(stream);
     lwuitImage.image.SetResolution(96, 96);
     return lwuitImage;
 }
Пример #2
0
        public IImage ModifyAlpha(byte alpha, int removeColor)
        {
            NETImage lwuitImage = new NETImage();

            lwuitImage.image = new Bitmap(image.Width, image.Height);
            lwuitImage.image.SetResolution(96, 96);
            System.Drawing.Color emptyColor = System.Drawing.Color.FromArgb(0);
            for (int i = 0; i < image.Width; i++)
            {
                for (int j = 0; j < image.Height; j++)
                {
                    System.Drawing.Color rgb  = image.GetPixel(i, j);
                    System.Drawing.Color rgb1 = System.Drawing.Color.FromArgb(alpha, rgb.R, rgb.G, rgb.B);
                    if ((rgb.ToArgb() & 0xffffff) == removeColor)
                    {
                        lwuitImage.image.SetPixel(i, j, emptyColor);
                    }
                    else
                    {
                        lwuitImage.image.SetPixel(i, j, rgb1);
                    }
                }
            }
            return(lwuitImage);
        }
Пример #3
0
 public static IImage createImage(int width,
                             int height)
 {
     NETImage lwuitImage = new NETImage();
     lwuitImage.image = new Bitmap(width, height);
     lwuitImage.image.SetResolution(96,96);
     return lwuitImage;
 }
 public override IImage CreateImage(Stream stream)
 {
     try {
         return(NETImage.createImage(stream));
     } catch (IOException ex) {
     }
     return(null);
 }
Пример #5
0
        public static IImage createImage(Stream stream)
        {
            NETImage lwuitImage = new NETImage();

            lwuitImage.image = new Bitmap(stream);
            lwuitImage.image.SetResolution(96, 96);
            return(lwuitImage);
        }
Пример #6
0
        public static IImage createImage(int width,
                                         int height)
        {
            NETImage lwuitImage = new NETImage();

            lwuitImage.image = new Bitmap(width, height);
            lwuitImage.image.SetResolution(96, 96);
            return(lwuitImage);
        }
Пример #7
0
 public static IImage createImage(byte[] bytes,
                             int offset,
                             int len)
 {
     //NETImage lwuitImage = new NETImage();
     //lwuitImage.image = Bitmap.CreateImage(bytes, offset, len);
     MemoryStream memoryStream = new MemoryStream(bytes, offset, len);
     NETImage lwuitImage = new NETImage();
     lwuitImage.image = new Bitmap(memoryStream);
     lwuitImage.image.SetResolution(96, 96);
     return lwuitImage;
 }
Пример #8
0
        public static IImage createImage(byte[] bytes,
                                         int offset,
                                         int len)
        {
            //NETImage lwuitImage = new NETImage();
            //lwuitImage.image = Bitmap.CreateImage(bytes, offset, len);
            MemoryStream memoryStream = new MemoryStream(bytes, offset, len);
            NETImage     lwuitImage   = new NETImage();

            lwuitImage.image = new Bitmap(memoryStream);
            lwuitImage.image.SetResolution(96, 96);
            return(lwuitImage);
        }
Пример #9
0
 public static IImage createImage(int[] rgb, int width, int height)
 {
     NETImage lwuitImage = new NETImage();
     lwuitImage.image = new Bitmap(width, height);
     lwuitImage.image.SetResolution(96, 96);
     for (int i = 0; i < width; i++)
     {
         for (int j = 0; j < height; j++)
         {
             lwuitImage.image.SetPixel(i, j, System.Drawing.Color.FromArgb(rgb[i * height + j]));
         }
     }
     return lwuitImage;
 }
Пример #10
0
        public static IImage createImage(int[] rgb, int width, int height)
        {
            NETImage lwuitImage = new NETImage();

            lwuitImage.image = new Bitmap(width, height);
            lwuitImage.image.SetResolution(96, 96);
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    lwuitImage.image.SetPixel(i, j, System.Drawing.Color.FromArgb(rgb[i * height + j]));
                }
            }
            return(lwuitImage);
        }
Пример #11
0
        public IImage SubImage(int x, int y, int width, int height, bool processAlpha)
        {
            NETImage lwuitImage = new NETImage();

            lwuitImage.image = new Bitmap(width, height);
            lwuitImage.image.SetResolution(96, 96);
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    int rgb = image.GetPixel(x + i, y + j).ToArgb();
                    lwuitImage.image.SetPixel(i, j, System.Drawing.Color.FromArgb(rgb));
                }
            }


            return(lwuitImage);
        }
Пример #12
0
        public IImage SubImage(int x, int y, int width, int height, bool processAlpha)
        {
            NETImage lwuitImage = new NETImage();
            lwuitImage.image = new Bitmap(width, height);
            lwuitImage.image.SetResolution(96, 96);
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    int rgb = image.GetPixel(x + i, y + j).ToArgb();
                    lwuitImage.image.SetPixel(i, j, System.Drawing.Color.FromArgb(rgb));
                }
            }

            return lwuitImage;
        }
Пример #13
0
        public IImage ModifyAlpha(byte alpha, int removeColor)
        {
            NETImage lwuitImage = new NETImage();
            lwuitImage.image = new Bitmap(image.Width, image.Height);
            lwuitImage.image.SetResolution(96, 96);
            System.Drawing.Color emptyColor = System.Drawing.Color.FromArgb(0);
            for (int i = 0; i < image.Width; i++)
            {
                for (int j = 0; j < image.Height; j++)
                {
                    System.Drawing.Color rgb = image.GetPixel(i, j);
                    System.Drawing.Color rgb1 = System.Drawing.Color.FromArgb(alpha, rgb.R, rgb.G, rgb.B);
                    if ((rgb.ToArgb() & 0xffffff) == removeColor)
                    {
                        lwuitImage.image.SetPixel(i, j, emptyColor);
                    }
                    else
                    {
                        lwuitImage.image.SetPixel(i, j, rgb1);
                    }

                }
            }
            return lwuitImage;
        }
 public override IImage CreateImage(byte[] bytes, int offset, int len)
 {
     return(NETImage.createImage(bytes, offset, len));
 }
 public override IImage CreateImage(int[] rgb, int width, int height)
 {
     return(NETImage.createImage(rgb, width, height));
 }