Note that there are some explanatory texts on larger screens.

plurals
  1. POImage shows up blurred in UIImageView
    primarykey
    data
    text
    <p>I am creating an app where a user can load their schedule into the app, and it is subsequently displayed.</p> <p>When the image is allowed to be edited before loading, it shows up perfectly:</p> <p><img src="https://i.stack.imgur.com/K00U2.png" alt="Image 1"></p> <p>Once the user "chooses" the image, it shows up in the <code>UIImageView</code> blurred:</p> <p><img src="https://i.stack.imgur.com/aR04F.png" alt="Image 2"></p> <p>Here it is slightly zoomed in:</p> <p><img src="https://i.stack.imgur.com/PowfW.png" alt="Image 3"></p> <p>I know that the image resolution is okay because image displays perfectly beforehand. <strong>How can I stop this from being blurred?</strong></p> <p>I am using the basic method of zooming an <code>UIImageView</code> in an <code>UIScrollView</code>.</p> <p>Here is the code I use to assign the image. zoomscroll is the <code>UIScrollView</code> and myschedule is the <code>UIImageView</code>:</p> <pre><code>-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self dismissModalViewControllerAnimated:YES]; //Obtaining saving path NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *imagePath = [documentsDirectory stringByAppendingPathComponent:@"myschedule.png"]; //Extracting image from the picker and saving it NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType]; if ([mediaType isEqualToString:@"public.image"]){ UIImage *editedImage = [info objectForKey:UIImagePickerControllerEditedImage]; NSData *webData = UIImagePNGRepresentation(editedImage); [webData writeToFile:imagePath atomically:YES]; myschedule.image = editedImage; [zoomscroll addSubview:myschedule]; zoomscroll.contentSize = CGSizeMake(myschedule.frame.size.width , myschedule.frame.size.height); zoomscroll.minimumZoomScale = 1.0; zoomscroll.maximumZoomScale = 4.0; } } </code></pre> <p>Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload