Re: drawing into NSBitmapImageRep
Re: drawing into NSBitmapImageRep
- Subject: Re: drawing into NSBitmapImageRep
- From: Chris Meyer <email@hidden>
- Date: Tue, 18 Feb 2003 17:51:49 -0800
Not sure off the top of my head but does using
lockFocusOnRepresentation work?
Thanks for the suggestion but unfortunately my sample doesn't work
using lockFocusOnRepresentation either.
I think that Cocoa doesn't support drawing INTO bitmaps; one is
expected to use NSBitmapImageRep's initWithFocusedViewRect or a
combination of NSImage's TIFFRepresentation and NSBitmapImageRep's
initWithData. The problem with these techniques is that I can't predict
the data type of the resulting NSBitmapImageRep.
Right now I'm looking into CoreGraphics so see if it will do the
conversion more directly.
On Tuesday, February 18, 2003, at 05:27 PM, Shawn Erickson wrote:
On Tuesday, February 18, 2003, at 12:30 PM, Chris Meyer wrote:
Can someone explain why the code below doesn't work as expected (i.e.
draw the orange rectangle into the bitmap)?
Is there any way to draw into a bitmap such that the bitmap has a
specific format pixel format?
[snip]
[temp_image lockFocus];
NSEraseRect( NSMakeRect(0,0,200,200) );
[[NSColor orangeColor] set];
NSFrameRectWithWidth( NSMakeRect(50,50,100,100), 10 );
[temp_image unlockFocus];
Not sure off the top of my head but does using
lockFocusOnRepresentation work?
You didn't really say how it didn't work...
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.