【问题标题】:Image quality lower is not like displaying in photo album图像质量较低不像在相册中显示
【发布时间】:2012-09-05 03:36:13
【问题描述】:

您好,我是 iOS 新手。

我正在开发一款应用,它包含照片编辑功能。为此,我可以从照片库中挑选照片。我可以成功地挑选照片并将其放在 UIImageView 中。但我觉得它不是那么好。在相册中显示和在 UIImageView 中显示有很多不同。

我希望像显示在相册中一样显示它。我怎样才能做到这一点?

请指导我。

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    // Access the uncropped image from info dictionary
    UIImage *originalImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
    NSLog(@"size of originalImage is %@",NSStringFromCGSize(originalImage.size));
    editingPhotoImgVw.frame = CGRectMake(0, 0, 320,self.view.frame.size.height);
    editingPhotoImgVw.image =originalImage;
    [editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit];
    [self.view addSubview:editingPhotoImgVw];
    [self dismissModalViewControllerAnimated:YES];
    [picker release];

}

相册中显示

在应用中显示

根据 iSanjay cmets 将 [editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit]; 更改为 [editingPhotoImgVw setContentMode:UIViewContentModeScaleToFill];

【问题讨论】:

    标签: iphone ios uiimageview camera photolibrary


    【解决方案1】:

    您正在使用像

    这样的图像内容模式
    [editingPhotoImgVw setContentMode:UIViewContentModeScaleAspectFit];
    

    而不是这个尝试

    [editingPhotoImgVw setContentMode:UIViewContentModeScaleToFill];
    

    这样做。

    【讨论】:

    • 是的,它几乎可以工作,但我仍然能感觉到那里有一些噪音。
    • 您现在可以发布您当前的图片吗?所以我可以看到
    • 这个问题也出现在你的第一张图片中。看到在uiimageview中显示后图像质量变差了。除了您使用哪种模式无关紧要。它的分辨率问题您的 iPhone Camrea 分辨率很高,这就是出现此问题的原因。
    • 有没有什么办法可以达到像相册一样的画质。
    • 看到这个link
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-14
    • 1970-01-01
    • 2013-07-28
    相关资源
    最近更新 更多