2
필자 IOS 7에 내 프로젝트 업데이트 한 번 추가 된 이미지의 크기를 조정하면 지금은이 오류를 얻고있다/응용 프로그램 내 촬영은 여기 내 코드암시 적 변환 'CGImageAlphaInfo'
-(UIImage *)resizeImage:(UIImage *)anImage width:(int)width height:(int)height
{
CGImageRef imageRef = [anImage CGImage];
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef);
if (alphaInfo == kCGImageAlphaNone)
alphaInfo = kCGImageAlphaNoneSkipLast;
CGContextRef bitmap = CGBitmapContextCreate(NULL, width, height, CGImageGetBitsPerComponent(imageRef), 4 * width, CGImageGetColorSpace(imageRef), alphaInfo);
CGContextDrawImage(bitmap, CGRectMake(0, 0, width, height), imageRef);
CGImageRef ref = CGBitmapContextCreateImage(bitmap);
UIImage *result = [UIImage imageWithCGImage:ref];
CGContextRelease(bitmap);
CGImageRelease(ref);
return result;
}
오류 메신저입니다 열거 형 다른 열거 형 'CGBitmapInfo'(일명 '열거 CGBitmapInfo')에 'CGImageAlphaInfo'(일명 '열거 CGImageAlphaInfo')에서이
암시 적 변환이되어지고
가능한 중복 ([I 알파에만 비트 맵 컨텍스트를 만들려면 어떻게해야합니까] http://stackoverflow.com/questions/17245787/how-do-i-create-an-alpha 해결 -only-bitmap-context) – rmaddy
이 링크 참조 http://stackoverflow.com/questions/18921703/implicit-conversion-from-enumeration-type-enum-cgimagealphainfo-to-different-e – Siva