Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bulletproof way to create a new CGBitmapContext from an existing image?



Hi Steve and David,

Thank you both for your comments; they were very helpful. I had thought that I had to match the context to the image I was going to use, but that's clearly wrong. I had missed that link to the supported pixel formats - that's very informative.

Steve's comment also suggested to me (if this will help) another trick. I created the context with the *cropped* image size. When I draw the image in the context, I specify a rect positioned such that the context region contains the bit I want cropped, i.e. specify a rect that is larger than the bounds of the context. CG scales it as appropriate, but I only get the bit that I want.

Again, thanks very much for the help!

Cheers,
Demitri

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Bulletproof way to create a new CGBitmapContext from an existing image? (From: email@hidden)
 >Re: Bulletproof way to create a new CGBitmapContext from an existing image? (From: David Duncan <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.