J
James Dean
I create a bitmap like this.
The width and height are got from the compressed file i am reading. The
width and height are in pixels.....1bpp
bitmap = new Bitmap(Width,Height,PixelFormat.Format24bppRgb);
i have a bitmapdata class and then lock the bits like this.
bitmapData =
bitmap.LockBits(bounds, ImageLockMode.ReadWrite,
PixelFormat.Format24bppRgb);
pBase = (Byte*) bitmapData.Scan0.ToPointer();
My problem is i want to set the values of these bytes. I thought i was
setting the values but i am not doing it right for some reason.
I followed this example but here he reads in and changes the bitmap.....
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol
/html/csharp11152001.asp
I create the bitmap myself and change the values...but its different...
What i want to know is if somebody could tell me how to create a 24bpp
bitmap and then set any values in it...just a small example...just some
bytes in the bitmap and actually display this.....at the moment all i
get is rubbish as a result. I get just a black bitmap all the time when
i display it......whats wrong i wonder?.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
The width and height are got from the compressed file i am reading. The
width and height are in pixels.....1bpp
bitmap = new Bitmap(Width,Height,PixelFormat.Format24bppRgb);
i have a bitmapdata class and then lock the bits like this.
bitmapData =
bitmap.LockBits(bounds, ImageLockMode.ReadWrite,
PixelFormat.Format24bppRgb);
pBase = (Byte*) bitmapData.Scan0.ToPointer();
My problem is i want to set the values of these bytes. I thought i was
setting the values but i am not doing it right for some reason.
I followed this example but here he reads in and changes the bitmap.....
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol
/html/csharp11152001.asp
I create the bitmap myself and change the values...but its different...
What i want to know is if somebody could tell me how to create a 24bpp
bitmap and then set any values in it...just a small example...just some
bytes in the bitmap and actually display this.....at the moment all i
get is rubbish as a result. I get just a black bitmap all the time when
i display it......whats wrong i wonder?.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!