You can set the value of the property 'contentsGravity' to
kCAGravityResizeAspect.
Read about 'Positioning contents within a layer' at:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/ProvidingCALayerContent.html
-Shripada
On 02-Jul-08, at 1:03 PM, [EMAIL PROTECTED] wrote:
Message: 3
Date: Tue, 1 Jul 2008 20:39:51 -0700
From: "Wayne Shao" <[EMAIL PROTECTED]>
Subject: CALayer contents and image aspect ratio
To: Cocoa <cocoa-dev@lists.apple.com>
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
I provide a CGImageRef as the layer content. When the bounds of layer
is changed, the image seems to be scaled to fit the bounds.
Is there an option to keep the image aspect ratio? what possible
key-value can I set for the layer's style property?
Thanks,
--
Wayne Shao
-----------------------------------------------
Robosoft Technologies - Come home to Technology
Disclaimer: This email may contain confidential material. If you were not an
intended recipient, please notify the sender and delete all copies. Emails to
and from our network may be logged and monitored. This email and its
attachments are scanned for virus by our scanners and are believed to be safe.
However, no warranty is given that this email is free of malicious content or
virus.
_______________________________________________
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]