开发者

iPhone - preventing slowdown due to setting a image to an UIImageView

I have a method that gets the image taken from the iPhone camera, put it into an UIImageView, then call another method for custom drawing into a custom UIView.

I've noticed that when I take the photo from the front camera of the iPhone 4, the custom UIView drawing is ok and smooth. When taking the photo from the back camera, then the custom drawing is jerky, sometime it even do not display all the "frames" it has to display.

How may I prevent t开发者_Go百科hose jerks in a conrete way, knowing that my custom animation MUST begin when the image is displayed into the UIImageView ?

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage* pickedImage = [[info objectForKey:UIImagePickerControllerOriginalImage] retain];
    UIImageWriteToSavedPhotosAlbum (pickedImage, self, @selector(photoSaved:didFinishSavingWithError:contextInfo:), nil);
   self.photoShoot.image = pickedImage;
    [pickedImage release];

    [self.customviewfordrawings makeyourdrawstuff];
}

When commenting the self.photoShoot.image = pickedImage;, no more jerk whatever camera is used.

Note : The UIImageWriteToSavedPhotosAlbumcall may not be in cause because putting it or not in the code does not affect the problem.


Perhaps the image is a little too big to display smoothly. Try creating a resized version and display that in the imageView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜