0

I create an image using the following method by passing the two parameter one is UIImage object is imagdata and NSString object is storeImage

JPG: [UIImageJPEGRepresentation(imageData, 1.0) writeToFile:storeImage atomically:YES]; or PNG: [UIImagePNGRepresentation(imageData) writeToFile:storeImage atomically:YES];

my problem is that, original image size is 2.1 MB after i using the above method the image size is 4.2 MB in simulator.

I don't want to use any compression method and i don't want to loss any quality of image. i want copy the image as it is in given path. in actual size.

4

2 に答える 2

0

画像の単純なデータ オブジェクトを使用します。NSData オブジェクト内の imageData の次のコードを試してください。

[imageData writeToFile:storeImage アトミック:YES];

于 2012-11-20T08:04:57.123 に答える
0

元のサイズとフォーマットを教えてください。
サイズを小さくする 1 つの方法は、品質を少し落とすことです。

[UIImageJPEGRepresentation(imageData, 0.5) writeToFile:storeImage atomically:YES]

もう 1 つの方法は、ImageIO フレームワークを使用することです。

于 2012-11-20T08:11:51.407 に答える