On Jan 27, 2012, at 11:48 PM, Robert Purves wrote:
> Just a reminder that there's a better way to create a CGImage from a file.
Thanks Robert. Like usual, there are several approaches. Noticed it is also possible to use:
dim as HIViewContentInfo hivcontent
dim as CFURLRef fileUrl
fileUrl = fn CFBundleCopyResourceURL( fn CFBundleGetMainBundle(), @"some.jpg", 0, 0 )
hivcontent.contentType = _kHIViewContentImageFile
hivcontent.u.imageFile = fileUrl
err = fn HIViewSetImageContent( imageView, _kHIViewEntireView, hivcontent )
this would be after creating an empty image view with: fn HIImageViewCreate ( NULL, imageView )
Thanks to RC for his comments too.
Brian S