#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了很久也没找到原因,想询问一下各位高手。
取CGImage的图片是否会自动变得模糊?我打印了一下assets.thumbnail的height width的值。但是发现不管怎样都只有157?
那不是缩略图吗????????
将asset.thumbnail 改为:[[asset defaultRepresentation] fullScreenImage]] 应该就可以了。
楼上正解,asset.thumbnail是缩略图。
请问你这个问题解决了吗 我也遇到了 能不能给我说一下你怎么解决的 我的 QQ314955470
不要用asset.thumbnail,要用aspectRatioThumbnail就可以了。