特例独行的猿 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?

    评论

报告相同问题?

悬赏问题

  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥85 maple软件,solve求反函数,出现rootof怎么办?
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题