use*_*878 12 iphone iphone-sdk-3.0
我在我的应用程序中截取屏幕截图.我可以截取屏幕截图.
现在我想通过指定x和y坐标来截取屏幕截图.那可能吗?
UIGraphicsBeginImageContext( self.view.bounds.size );
[self.view.layer renderInContext:UIGraphicsGetCurrentContext( )];
UIImage* aImage = UIGraphicsGetImageFromCurrentImageContext( );
Run Code Online (Sandbox Code Playgroud)
ken*_*ytm 18
UIGraphicsBeginImageContext(self.view.bounds.size);
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(c, 0, -40); // <-- shift everything up by 40px when drawing.
[self.view.layer renderInContext:c];
UIImage* viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
17585 次 |
| 最近记录: |