tags:

views:

114

answers:

1

I use a full screen imageView to display the image, as follows:

UIImageView*imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)]
imageView.contentMode=UIViewContentModeScaleAspectFit;
imageView.image=srcImage;

As the srcImage size differs, its position (frame) in the imageView differs, how can I get the position of the image in imageView?

thanks a lot.

+1  A: 

You have to do the math yourself. Calculate the aspect ratio of your image and compare with the aspect ratio of the image view's bounds.

Ole Begemann