Modifying bitmap data
Modifying bitmap data
- Subject: Modifying bitmap data
- From: Joel Reymont <email@hidden>
- Date: Mon, 8 Aug 2005 01:02:37 +0200
Folks,
I'm trying to modify the bits of the image and the changes don't seem
to take effect once the image is displayed. Any tips?
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc]
initWithData: [image TIFFRepresentation]];
int w = [imageRep pixelsWide];
int h = [imageRep pixelsHigh];
unsigned char *data = [imageRep bitmapData];
int x, y;
for ( y = 0; y < h; y++ ) {
for ( x = 0; x < w; x++ ) {
*(data + w * y + x) = 0;
}
}
Thanks, Joel
--
http://wagerlabs.com/uptick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden