Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Displaying Images using PICT in Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Images using PICT in Interface Builder




On Jun 12, 2007, at 6:15 AM, Martin Kyte wrote:

Hi Chaps.
How do you use the PICT enhanced control to display permanent images in a window.
I can get the whole thing working in interface builder by copying a TIFF resource from Photoshop to the project using Project - Add to Project menu item and moving it to the resource folder. two images are displayed ing the Images part of main.nib and I can drag either of them onto the PICT control on the interface. Test interface shows the image correctly but building and running the project does not.I'm starting out with all this from O'Rreilly's learning carbon. I realise this is a little out of date but one has to start somewhere.



It would probably be better to use HIImageView, actually. The PICT control can only display PICT resources, and it would be somewhat awkward to convert a tiff to a PICT. HIImageView can display any arbitrary CGImageRef, however, and it's easy to create a CGImageRef from a tiff file using the ImageIO framework; see http://developer.apple.com/graphicsimaging/workingwithimageio.html for sample code. Once you've got the CGImageRef, use HIImageViewSetImage to make the image view display it.


-eric

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


References: 
 >Displaying Images using PICT in Interface Builder (From: Martin Kyte <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.