G
Guest
Hi,
I'm combining the pixels from 2 Bitmap classes, one is an overlay onto the
other. I'm currentlly doing it this way, using C#:
// Copy the overlay data onto the image file.
Color OverlayPixel;
for( int i = 0; i < PngImage.Width; i++)
for( int j = 0; j < PngImage.Height; j++)
{
OverlayPixel = PngOverlay.GetPixel( i, j);
if( OverlayPixel != System.Drawing.Color.Black)
{
PngImage.SetPixel( i, j, OverlayPixel);
}
}
This works, but is horribly slow, and will get even more so when I end up
doing this on larger images.
I believe this would go significantly faster if I worked on the pixel data
directly instead of going through GetPixel & SetPixel methods. Is there a
way to get the pixel data in a Bitmap class into a byte array?
Thanks Bruce
I'm combining the pixels from 2 Bitmap classes, one is an overlay onto the
other. I'm currentlly doing it this way, using C#:
// Copy the overlay data onto the image file.
Color OverlayPixel;
for( int i = 0; i < PngImage.Width; i++)
for( int j = 0; j < PngImage.Height; j++)
{
OverlayPixel = PngOverlay.GetPixel( i, j);
if( OverlayPixel != System.Drawing.Color.Black)
{
PngImage.SetPixel( i, j, OverlayPixel);
}
}
This works, but is horribly slow, and will get even more so when I end up
doing this on larger images.
I believe this would go significantly faster if I worked on the pixel data
directly instead of going through GetPixel & SetPixel methods. Is there a
way to get the pixel data in a Bitmap class into a byte array?
Thanks Bruce