T
TC
Hi folks
In my current project I have to use the GDI+ flat API from MS Visual
Basic for Applications (VBA). I can't use C++, VB.NET, or anything
similar, for various reasons. It is working fine so far. I can open
images, edit them in various ways, save them as different types, & so
on.
But! How do you change the color of a specified pixel within an
*pallette-indexed* image?
I have an 8 bits-per-pixel palette-indexed PNG image.
GdipBitmapGetPixel returns the actual color value, so it must be
getting the pixel value then indexing into the color palette "behind
the scenes" to get that color. But when I use GdipBitmapSetPixel to
change the pixel color, I get error 2, invalid parameter.
I can understand why set-pixel won't accept an actual color value (for
an indexed image): what if that color was not in the palette? But it
doesn't seem to accept a palette index either (1, 2, 3 etc.).
So, how do you change the color of a specified pixel in an
indexed-pallette image?
TIA
TC
In my current project I have to use the GDI+ flat API from MS Visual
Basic for Applications (VBA). I can't use C++, VB.NET, or anything
similar, for various reasons. It is working fine so far. I can open
images, edit them in various ways, save them as different types, & so
on.
But! How do you change the color of a specified pixel within an
*pallette-indexed* image?
I have an 8 bits-per-pixel palette-indexed PNG image.
GdipBitmapGetPixel returns the actual color value, so it must be
getting the pixel value then indexing into the color palette "behind
the scenes" to get that color. But when I use GdipBitmapSetPixel to
change the pixel color, I get error 2, invalid parameter.
I can understand why set-pixel won't accept an actual color value (for
an indexed image): what if that color was not in the palette? But it
doesn't seem to accept a palette index either (1, 2, 3 etc.).
So, how do you change the color of a specified pixel in an
indexed-pallette image?
TIA
TC