예제 #1
0
        public static Bitmap ToBitmap(ByteMatrix matrix)
        {
            int    width  = matrix.Width;
            int    height = matrix.Height;
            Bitmap bmap   = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    bmap.SetPixel(x, y,
                                  matrix.GetRenamed(x, y) != -1
                                      ? ColorTranslator.FromHtml("0xFF000000")
                                      : ColorTranslator.FromHtml("0xFFFFFFFF"));
                }
            }
            return(bmap);
        }