ios - how to compress an UIImagePNGRepresentation -


I am using the following code to save an image captured by the camera and saves the core data, But it is very big and it needs to be reduced, it is the perfect one.

  NSData * image = [NSData DataWidth Data: UIImagePNGRepresentation (self.imageView.image)];  

The length of NSDT is 1048 and I need as much seconds as possible

Here is a method that will change the size of the original image to a new sequence:

  - (UIImage *) imageWithImage: (UIImage *) originalImage scaledToSize: (CGSize) newSize; {@ Synchronize (auto) {UIGraphicsBeginImageContext (newSize); [Original image drawInRect: CGRactMake (0,0, new size.width, new size. Hi)]; UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); New image refund; } Return zero; }  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -