【发布时间】:2011-07-25 01:41:38
【问题描述】:
我正在从 currentview 截取屏幕截图。但我想设置框架……不想将全视图转换为图像。我给了框架大小……但它总是需要 图片为全视图..有什么帮助吗?
CGRect rectt = CGRectMake(100, 150,150,200);
UIGraphicsBeginImageContext(rectt.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageView *imgView = [[UIImageView alloc] initWithFrame:rectt];
【问题讨论】:
标签: iphone ipad ios4 iphone-sdk-3.0 cgcontext