How to get Image size in Objective-C.
I loaded one image using imagePicker, I want know the size of that image. (w*h)
is it possible?
Thanks & regards...
You implement the UIImagePickerControllerDelegate Protocol and in particular the imagePickerController:didFinishPickingMediaWithInfo: method. The last parameter in that method is a dictionary that includes an UImage references by the UIImagePickerControllerOriginalImage key. Get this UIImage* and get it's size property.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *image = (UIImage*) [info objectForKey:UIImagePickerControllerOriginalImage];
//access width and height like this
image.size.width;
image.size.height;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With