• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: drawing into NSBitmapImageRep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: drawing into NSBitmapImageRep (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: 1 pixel width NSBezierPath issue
  • Next by Date: Re: Invalid window error for a status bar item popup
  • Previous by thread: Re: drawing into NSBitmapImageRep
  • Next by thread: Re: drawing into NSBitmapImageRep [SOLVED]
  • Index(es):
    • Date
    • Thread