public static Bitmap AsBitmap(this IPalette palette) { var b = new Bitmap(Size, 1, PixelFormat.Format32bppArgb); var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); var temp = new uint[Size]; palette.CopyToArray(temp, 0); Marshal.Copy((int[])(object)temp, 0, data.Scan0, Size); b.UnlockBits(data); return(b); }
void CopyPaletteToBuffer(int index, IPalette p) { p.CopyToArray(buffer, index * Palette.Size); }
public void CopyToArray(Array destination, int destinationOffset) { palette.CopyToArray(destination, destinationOffset); }
public void SetFromPalette(IPalette p) { p.CopyToArray(colors, 0); }