3
我試圖與2px的透明邊框繪製圖像:CoreGraphics中:圖像透明背景
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 0.0);
CGContextAddRect(context, CGRectMake(0.0, 0.0, outputImageSize.width, outputImageSize.height));
CGContextDrawPath(context, kCGPathFill);
[image drawInRect:CGRectMake(2.0,
((outputImageSize.height - userPhotoImageSize.height)/2.0) +2.0,
userPhotoImageSize.width -4.0,
userPhotoImageSize.height -4.0)];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
它使越來越黑邊(背景)... =(任何想法
解決了,其中我設置圖像uiimageview只是簡單的黑色背景=(上述代碼的作品!
這是從哪裏調用? – 2011-04-11 02:02:04