如果我加载vIEwcontroler然后拍摄快照然后它正在工作但我的要求是做同样的事情而不在屏幕上加载vIEwcontroler.
请提供想法或链接或代码段.解决方法 试试这个:-
制作要拍摄屏幕截图的VC实例,然后在此方法中传递对象.
+ (UIImage *)renderImageFromVIEw:(UIVIEw *)vIEw withRect:(CGRect)frame {// Create a new context the size of the frameUIGraphicsBeginImageContextWithOptions(frame.size,YES,0);CGContextRef context = UIGraphicsGetCurrentContext();// Render the vIEw[vIEw.layer renderInContext:context];//[vIEw drawRect:frame];// Get the image from the contextUIImage *renderedImage = UIGraphicsGetimageFromCurrentimageContext();// Cleanup the context you createdUIGraphicsEndImageContext();return renderedImage;}@H_502_0@ 总结
以上是内存溢出为你收集整理的如何拍摄视频控制器的快照而不在ios的屏幕中加载?全部内容,希望文章能够帮你解决如何拍摄视频控制器的快照而不在ios的屏幕中加载?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)