• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CALayer bounds with ResizeAspect mask?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer bounds with ResizeAspect mask?


  • Subject: Re: CALayer bounds with ResizeAspect mask?
  • From: Matt Long <email@hidden>
  • Date: Wed, 8 Oct 2008 08:04:19 -0600

Colin,

Not sure I completely understand that issue, but in a QTMovieLayer, the movie is tied to the layer dimensions. If you resize the layer, you resize the movie. The layer itself has a frame and a bounds property. All you should need to do is grab [myMovieLayer bounds] or [myMovieLayer frame] to get the new width and height.

float newWidth = [myMovieLayer bounds].size.width;
float newHeight = [myMovieLayer bounds].size.height;

You should also take a look at:

http://developer.apple.com/documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/LayerTreeHierarchy.html#/ /apple_ref/doc/uid/TP40006083-SW9

Specifically the part about autoresizing sublayers.

-Matt






On Oct 8, 2008, at 3:01 AM, Colin Doncaster wrote:

Hi there,

I'm using a QTMovieLayer with

[myMovieLayer setContentsGravity:kCAGravityResizeAspect];

specified.

I have a second layer that I'd like to draw on that needs to match the resized movie that is now scaled to maintain the correct aspect ratio. Is there a way of retrieving the resized movie bounds?

I know I can compute it myself, but it seems like there would be a way of accessing the resized movie dimensions. I tried the CGImageRef, but it just returns the resolution of the QTMovie.

thanks.
_______________________________________________

_______________________________________________

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: CALayer bounds with ResizeAspect mask?
      • From: Colin Doncaster <email@hidden>
References: 
 >CALayer bounds with ResizeAspect mask? (From: Colin Doncaster <email@hidden>)

  • Prev by Date: NSOpenGLView does not update view
  • Next by Date: Re: NSPersistentDocument No Support "Save To" ("Save As"?)
  • Previous by thread: CALayer bounds with ResizeAspect mask?
  • Next by thread: Re: CALayer bounds with ResizeAspect mask?
  • Index(es):
    • Date
    • Thread