[英]image size on Objective-c,
how to get Image size in objecive-c, 如何在objecive-c中获得图像大小,
i loaded one image using imagePicker, i want know the size of that image. 我使用imagePicker加载了一个图像,我想知道该图像的大小。 (w*h)
(W * H)
is it possible. 可能吗。 ?
?
Thanks & regards... 感谢和问候...
You implement the UIImagePickerControllerDelegate Protocol and in particular the imagePickerController:didFinishPickingMediaWithInfo:
method. 您实现了UIImagePickerControllerDelegate协议 ,特别是
imagePickerController:didFinishPickingMediaWithInfo:
方法。 The last parameter in that method is a dictionary that includes an UImage references by the UIImagePickerControllerOriginalImage
key. 该方法中的最后一个参数是一个字典,其中包含
UIImagePickerControllerOriginalImage
键的UImage引用。 Get this UIImage* and get it's size
property. 得到这个UIImage *并获得它的
size
属性。
- (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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.