特例独行的猿 2014-05-26 13:16 采纳率: 0%
浏览 5620

大家好,我是ios开发的一个小白,问一下关于IOS相册选取图片后图片模糊的原因。

#pragma mark - CGImagePickController NotificationCenter

  • (void) CTAssetsPickCGImage:(NSNotification *)notice
    {
    NSArray *assetArr = [notice object];
    for (int x = 0; x < assetArr.count; x ++) {
    if (frameX <6) {
    ALAsset * asset = [assetArr objectAtIndex:x];
    scaleImage = [UIImage imageWithCGImage:asset.thumbnail];

        CTAssetsImage = [[UIImageView alloc] initWithFrame:[self isIndex]];
        CTAssetsImage.image = scaleImage;
        CTAssetsImage.tag = 999 + frameX;
        [postView addSubview:CTAssetsImage];
    
        UIButton * CTAssetButton = [[UIButton alloc] initWithFrame:CTAssetsImage.frame];
        [CTAssetButton addTarget:self action:@selector(CTAssetsAction:) forControlEvents:UIControlEventTouchUpInside];
        CTAssetButton.tag = 999 + frameX;
        [postView addSubview:CTAssetButton];
    
        [[NSNotificationCenter defaultCenter] removeObserver:self name:@"CGImageCTAssetsPickController" object:nil];
    }
    else
    {
        [SVProgressHUD showErrorWithStatus:@"最多只能选择6张图片"];
    }
    

    }
    }

asset.thumbnail是一个CGImageRef的图片,我设置了一个UIImageView 大小是80*80,用于显示这张CGImageRef。然后我想点击到这张图片的时候,可以放大这张图片,还原回图片原先的样子,但是我发现图片变得模糊。google了很久也没找到原因,想询问一下各位高手。

  • 写回答

6条回答

  • 特例独行的猿 2014-05-26 13:39
    关注

    取CGImage的图片是否会自动变得模糊?我打印了一下assets.thumbnail的height width的值。但是发现不管怎样都只有157?

    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站