#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了很久也没找到原因,想询问一下各位高手。