On Mar 27, 2012, at 4:50 PM, Andreas Mayer wrote:

> The documentation for UIImage -scale says:
> 
> "If you load an image from a file whose name includes the @2x modifier, the 
> scale is set to 2.0. If the filename does not include the modifier but is in 
> the PNG or JPEG format and has an associated DPI value, a corresponding scale 
> factor is computed and reflected in this property. "
> 
> So I would expect PNG images to retain their scale value when saved and 
> loaded.
> 
> If this does not work, there seems to be a bug somewhere.
> Ray, did you try to explicitly set the image's scale value before creating 
> the PNG representation?

Well, I don't save it to a file, but to a NSData property on a Core Data 
managed object, and I use UIGraphicsBeginImageContextWithOptions, after which 
newImage = UIGraphicsGetImageFromCurrentImageContext() will set the scale of 
"newImage" appropriately (under retina to 2.0, I checked with setting a 
breakpoint and looking at the scale variable of the image)... It is more that 
the imageWithData class method on UIImage always will report a scale of 1.0 (is 
mentioned in this WWDC session I was talking about). Hmm...


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to