Re: Modifying bitmap data
Re: Modifying bitmap data
- Subject: Re: Modifying bitmap data
- From: Dan Treiman <email@hidden>
- Date: Sun, 7 Aug 2005 22:15:13 -0500
Try drawing imageRep, or creating a new image instance with the
modified bitmap. Since imageRep is created from [image
TIFFRepresentation], it contains copies of the original image, not
references to its bitmap AFAIK.
-Dan T.
On Aug 7, 2005, at 6:02 PM, Joel Reymont wrote:
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
_______________________________________________
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