• 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: How can I use CGrafPtr value?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I use CGrafPtr value?


  • Subject: Re: How can I use CGrafPtr value?
  • From: Uli Kusterer <email@hidden>
  • Date: Sun, 5 Mar 2006 07:15:37 +0100

On 05.03.2006, at 05:49, 이종웅 wrote:
how can I use CGrafPtr in my cocoa app?

Check out the Quickdraw docs. CGrafPtr is a pointer to a Quickdraw graphics port. Basically, what I'd do is open a CGContextRef for the CGrafPtr, and then use CoreGraphics to draw in that, but I think there's also a way to get a Cocoa NSGraphicsContext for a CGContextRef (at least if you're running Tiger), then you could use NSGraphicsContext on that.


Alternatively, you could do your Cocoa drawings into an NSImage, and then copy the contents of that image into the CGrafPort. To do that, you'd lock focus on the image, call -graphicsPort on the current graphics context (this gets you a CGContextRef) and then you can get a CGrafPort for that context and use e.g. Quickdraw's CopyBits call to copy the drawings from one port to the other.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ 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
References: 
 >How can I use CGrafPtr value? (From: "이종웅" <email@hidden>)

  • Prev by Date: Re: NSTableView and background color
  • Next by Date: Re: How can I use CGrafPtr value?
  • Previous by thread: How can I use CGrafPtr value?
  • Next by thread: Re: How can I use CGrafPtr value?
  • Index(es):
    • Date
    • Thread