コード例 #1
0
ファイル: NETImage.cs プロジェクト: 237rxd/maptiledownloader
 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
ファイル: NETImage.cs プロジェクト: 237rxd/maptiledownloader
 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;
 }
コード例 #4
0
 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
ファイル: NETImage.cs プロジェクト: 237rxd/maptiledownloader
 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
ファイル: NETImage.cs プロジェクト: 237rxd/maptiledownloader
 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
ファイル: NETImage.cs プロジェクト: 237rxd/maptiledownloader
        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
ファイル: NETImage.cs プロジェクト: 237rxd/maptiledownloader
        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;
        }
コード例 #14
0
 public override IImage CreateImage(byte[] bytes, int offset, int len)
 {
     return(NETImage.createImage(bytes, offset, len));
 }
コード例 #15
0
 public override IImage CreateImage(int[] rgb, int width, int height)
 {
     return(NETImage.createImage(rgb, width, height));
 }