Question

I've got a UIImageView which gets image from the camera;

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    image = [info objectForKey:UIImagePickerControllerOriginalImage];
    [imageView setImage:image];
    [self dismissViewControllerAnimated:YES completion:NULL];
}

How do I make it so the image does not squeeze into the UIImageview, but rather acts as a 'window' so you only see a certain section of the image, that is the size of my UIImageView?

Thanks for any help, all is appreciated!

Was it helpful?

Solution

imageview.contentMode = UIViewContentModeCenter;

will centre the image in the view, you can adjust the size of the view then to hide or show more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top