How to animate the change of image in an UIImageView?

I have an UIImageView with an image. Now I have a completely new image (graphic file), and want to display that in this UIImageView. If I just set myImageView.image = newImage; the new image is visible immediately. Not animatable. I want it to nicely fade into the new image. I thought maybe there’s a better … Read more

Convert between UIImage and Base64 string

Does anyone know how to convert a UIImage to a Base64 string, and then reverse it? I have the below code; the original image before encoding is good, but I only get a blank image after I encode and decode it. NSData *imageData = UIImagePNGRepresentation(viewImage); NSString *b64EncStr = [self encode: imageData]; NSString *base64String = [self … Read more

How to capture UIView to UIImage without loss of quality on retina display

My code works fine for normal devices but creates blurry images on retina devices. Does anybody know a solution for my issue? + (UIImage *) imageWithView:(UIView *)view { UIGraphicsBeginImageContext(view.bounds.size); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; } 17 Answers 17

iOS UIImagePickerController result image orientation after upload

I am testing my iPhone application on an iOS 3.1.3 iPhone. I am selecting/capturing an image using a UIImagePickerController: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; [imagePicker setDelegate:self]; [self.navigationController presentModalViewController:imagePicker animated:YES]; [imagePicker release]; – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { self.image = [info objectForKey:UIImagePickerControllerOriginalImage]; imageView.image = self.image; [self.navigationController dismissModalViewControllerAnimated:YES]; submitButton.enabled = YES; } I then … Read more