CGContextSetRGBFillColor() off by one?
CGContextSetRGBFillColor() off by one?
- Subject: CGContextSetRGBFillColor() off by one?
- From: Mike Manzano <email@hidden>
- Date: Thu, 29 May 2008 00:21:27 -0700
Hi there,
I have this code:
CGContextSetRGBFillColor(cref, 0xaa/255.0, 0xb0/255.0,0xc0/255.0, 1) ;
CGContextFillRect(cref, CGRectMake(0, 0, w, h)) ;
CGContextFlush(cref) ;
Later on, I get the image buffer to print out the contents of the
first pixel:
unsigned long*data = CGBitmapContextGetData (cref);
if (data != NULL)
NSLog( "%lx" , data[0]) ;
Here's the output:
c0b0a9ff
Regardless of what I set the red component to, the value in the actual
image buffer is always off by one (it is always exactly one less).
This does not seem to be true for the green and blue components.
Any ideas why?
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden