objective c - How to make UIImage shown as the size of the UIView -


  UIImage * image = (UIImage *) [info valueForKey: UIImagePickerControllerOriginalImage]; NSLog (@ "% f% f% f% f", (image.size.width / 9), (image.size.height / 16), (568 / image.size.height), (दौर ((568 / Image.size.height) * image.size.width))); यदि ((image.size.width / 9) & lt; (image.size.height / 16)) {imageLoad.frame = CGRectMake (0, 0, 320, round ((320 / image.size.height) * छवि size.height)); } और अगर ((image.size.width / 9) & gt; (image.size.height / 16)) {imageLoad.frame = CGRectMake (0, 0, गोल ((568 / image.size.height) * छवि। Size.width), 568); } और {imageLoad.frame = CGRectMake (0, 0, गोल ((568 / image.size.height) * image.size.width), 568); } NSLog (@ "% f% f", imageLoad.frame.size.width, imageLoad.frame.size.height); ImageLoad.hidden = नहीं; ImageLoad.image = image;   

मैंने UIImageView * imageLoad का उपयोग करके CGRectMake का आकार बदल दिया और मैंने सोचा कि UIImage * image UIImageView * imageLoad के आकार के रूप में दिखाया जाएगा। हालांकि, यह काम नहीं किया मुझे क्या करना चाहिए?

  // इसका अर्थ है कि आपकी छवि आपके दृश्य आकार में फिट है imageLoad.contentMode = UIViewContentModeScaleAspectFill    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -