0

Here is the deal, I have tried using both of the methods shown below to save an image to the photo library. Upon saving the image successfully and launching the Photos App to take a look at the image, the app automatically scales/resizes the image to full screen.

Is there any way to prevent this? It is annoying because to see the whole image the user needs to pinch the image out to show the whole thing. I have noticed a few of the more popular camera apps do not have this issue when saving to the photo library. I am curious what method they are using.

//Save to Photo Library;
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];
//CIImage *ciImage = image.CIImage;
[library writeImageToSavedPhotosAlbum:finalImage.CGImage
                          orientation:ALAssetOrientationUp
                      completionBlock:^(NSURL *assetURL, NSError *error) {
                          NSlog(@"Done");
                      }];

Save to Photo Library;
UIImageWriteToSavedPhotosAlbum(savedPhoto,nil,nil,nil);

Thank you for your help!

4

4 回答 4

1

在做了一些研究之后,这个问题没有解决方案。照片应用程序会自动放大图像以填满屏幕。

感谢所有的回复。

于 2012-10-21T03:08:36.970 回答
0

如果您查看 Apple 的 FrogScroller 示例应用程序,您会看到它们最初会首先加载低分辨率的图像,然后在缩放时使用由函数设置大小的 CATiledLayer setMaxMinZoomScalesForCurrentBounds

您可能想查看 WWDC 2010 的 scrollViews 视频以及 2011 以了解更多信息。乔希和伊丽莎很好地解释了发生了什么。

于 2012-07-16T19:42:56.750 回答
0

为什么不在保存之前将图像分层到具有清晰背景的全屏图像上?

于 2012-07-20T03:29:26.370 回答
0

保存图像应该没问题。

我认为您可以在使用图像时设置 UIView 属性 UIViewContentMode。

typedef enum {
UIViewContentModeScaleToFill,
UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent
UIViewContentModeScaleAspectFill,     // contents scaled to fill with fixed aspect. some portion of content may be clipped.
UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)
UIViewContentModeCenter,              // contents remain same size. positioned adjusted.
UIViewContentModeTop,
UIViewContentModeBottom,
UIViewContentModeLeft,
UIViewContentModeRight,
UIViewContentModeTopLeft,
UIViewContentModeTopRight,
UIViewContentModeBottomLeft,
UIViewContentModeBottomRight,

} UIViewContentMode;

希望能帮助到你。

于 2012-07-16T02:57:51.353 回答