Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: About DrawPicture() and GetPicture()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About DrawPicture() and GetPicture()




On Nov 29, 2005, at 10:30 AM, Nick Nallick wrote:


On Nov 29, 2005, at 5:12 AM, Oleg Svin wrote:

Since these functions are deprecated, it is a good idea to replace them with a modern stuff.

I would substitute GetPicture with this:
- read the content of the resource into a CFDataRef
- create a CGImageSourceRef from that data (probably, it would be wise to set kCGImageSourceTypeIdentifierHint to CFSTR ("public.image") or even CFSTR("com.apple.pict"))
- get a CGImage from it
- don't forget to release all these guys

Since PICT can contain vector image data it's probably better to use the PICT support in Quartz. You have to create a standard CoreGraphics data provider that refers to your PICT data, then use QDPictCreateWithProvider and QDPictDrawToCGContext.

That's true, but you should monitor the process closely.

Quartz and QuickDraw use very different imaging models and these two routines do not generate pixel-for-pixel renditions of the PICT data. As a result, you can get objectionable artifacts from using them. Converting the PICTs to JPEG or PNG may be important if the integrity of the image is important. (but as Nick implies... you would loose the "vector-like" nature of the metafile)

see also <http://developer.apple.com/documentation/Carbon/Conceptual/ QuickDrawToQuartz2D/tq_moving_data/chapter_5_section_1.html>

Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >About DrawPicture() and GetPicture() (From: Kevin Gu <email@hidden>)
 >Re: About DrawPicture() and GetPicture() (From: Oleg Svin <email@hidden>)
 >Re: About DrawPicture() and GetPicture() (From: Nick Nallick <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.