// 获取屏幕快照
private func screenShot() -> UIImage{
let window = UIApplication.shared.keyWindow!
UIGraphicsBeginImageContext(window.size) // 绘图
window.drawHierarchy(in: window.bounds, afterScreenUpdates: false) // 从图形上下文获取图片
let image = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() return image
}
相关文章
- 05-13FGUI在Container容器中的物体使用LocalToGlobal,获取屏幕坐标
- 05-13WPF 获取鼠标屏幕位置、窗口位置、控件位置
- 05-13JQuery实现最大化和最小化【对css控制以及获取屏幕大小等】
- 05-13VC获取屏幕分辨率大小
- 05-13hbuilder打包的应用上架appstore屏幕快照的生成方法
- 05-13通用Windows平台如何获取两个按钮以共享应用程序屏幕宽度的一半
- 05-13Windows 10 UWP获取内容对话框在屏幕上垂直居中显示在移动设备上
- 05-13Qt 获取QGraphicsItem在屏幕上的位置,在QGraphicsItem中获取全局位置,转换为screenPos
- 05-13屏幕快照做法
- 05-13Unity - Windows获取屏幕分辨率、可用区域