I have a TIFF image for which I wish to change the BitmapPalette
for a specific frame of the image.
I have the following code:
var width = image.Frames[0].PixelWidth;
var height = image.Frames[0].PixelHeight;
var dpiX = image.Frames[0].DpiX;
var dpiY = image.Frames[0].DpiY;
var listOfColors = new List<System.Windows.Media.Color>();
for (int i = 0; i < 256; i++)
{
listOfColors.Add(System.Windows.Media.Color.FromRgb((byte)i, (byte)i, (byte)i));
}
var pallet = new BitmapPalette(listOfColors);
newImage = new WriteableBitmap(width, height, dpiX, dpiY, PixelFormats.Indexed8, pallet );
This returns an white image: why? What am I doing wrong here?
Also, if you have any information on how can I parse a GGR file into a BitmapPalette
, that would be nice.