1
CIImage
をUIImage
に変換するこのカテゴリを作成しました。私が使用しているCIImage
はCIFilter
から来ています。これを実行するとCIImageサイズエクステント?
-(UIImage *)obtainImageWithRetinaScale:(CGFloat)scale
{
CIContext *context = [CIContext contextWithOptions:nil];
//CGRect frame = CGRectMake(0,0,700,392);
CGImageRef processedCGImage = [context createCGImage:self
fromRect:[self extent]];
UIImage *returnImage = [UIImage imageWithCGImage:processedCGImage
scale:scale
orientation:UIImageOrientationUp];
CGImageRelease(processedCGImage);
return returnImage;
}
は、[self extent]
はそれは(0、0、無限大、無限大)...そこは本当に膨大な数かろうじてあり、文字化け番号の矩形を与えます。
明らかに処理された画像はゼロです。
フレームを正しいサイズにすると、画像が正しく生成されます。
独自のカーネルを作成していますか? http://benbritten.com/2008/07/24/cifilter-infinite-extent-problems/ – HAS
これは役に立ちますか? http://stackoverflow.com/a/21787766/1489885 – HAS