public MemoryBitmap ToBitmap()
        {
            var mbmp = new MemoryBitmap(Width, Height);
            mbmp.Lock();

            for (uint y = 0; y < Height; y++) {
                for (uint x = 0; x < Width; x++) {
                    byte val = Data[y * Width + x];
                    var color = new RGB888(Palette[val]);
                    mbmp[x, y] = color;
                }
            }

            return mbmp;
        }
示例#2
0
 public static ushort PackValueFromColor888(RGB888 Color)
 {
     return PackValueFromRGB888(Color.R, Color.G, Color.B);
 }
示例#3
0
 public static RGB565 ToRGB565(RGB888 Color)
 {
     return new RGB565((byte)(Color.R >> 3), (byte)(Color.G >> 2), (byte)(Color.B >> 3));
 }
示例#4
0
 public static int SquareDifference(RGB888 Color0, RGB888 Color1)
 {
     return SquareDifference(Color0.R, Color0.G, Color0.B, Color1.R, Color1.G, Color1.B);
 }
示例#5
0
 public int SquareDifference(RGB888 Color)
 {
     return SquareDifference(this, Color);
 }
示例#6
0
 public static RGB888 Multiply(RGB888 Color, float Multiplier)
 {
     byte r, g, b;
     Multiply(Color.R, Color.G, Color.B, Multiplier, out r, out g, out b);
     return new RGB888(r, g, b, Color.Transparent);
 }
示例#7
0
 public static RGB888 Subtract(RGB888 Color0, RGB888 Color1)
 {
     byte r, g, b;
     Subtract(Color0.R, Color0.G, Color0.B, Color1.R, Color1.G, Color1.B, out r, out g, out b);
     return new RGB888(r, g, b, Color0.Transparent || Color1.Transparent);
 }
示例#8
0
 public RGB888 Subtract(RGB888 Color)
 {
     return Subtract(this, Color);
 }
示例#9
0
 public RGB888 Add(RGB888 Color)
 {
     return Add(this, Color);
 }