如何在 iPhone 上将 ascii 文本艺术转换为 UIImage
我将图像作为输入并将其转换为 ascii(实际上是两种格式 - 一个简单的字符串和一个 html 页面)。我用来将此 ascii 文本保存为 UIImage 的方法是在 UIWebView 中显示文本,并以编程方式获取其屏幕截图并保存。我的问题是,当我截取屏幕截图时,它只能捕获并保存可滚动视图的可见部分。
我的问题是除了使用 UIWebView 方法之外,还有其他方法可以将 ascii 保存为 UIImage 吗?如果我必须使用 UIWebView,有人可以建议如何重新滚动并拍摄第二个(也许更多)屏幕截图。
就此而言, 罗尔
I am taking image as an input and converting it into ascii(actually two formats-a simple character string and an html page out of it). The approach I am using to save this ascii text as UIImage is to display the text in UIWebView and take its screenshot programatically and save it. My problem here is that when I take the screenshot it is only able to capture and save the visible part of the scrollable view.
My question is that is there an alternate way of saving the ascii as UIImage other then going the UIWebView approach. If I have to use UIWebView could someone suggest how to go about re-scrolling and taking the second(and maybe more) screenshot.
with regards,
Rol
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
drawAtPoint:withAttributes
方法在视图中绘制字符串对象。然后将视图的内容转换为 UIImage 对象,如所讨论的Use
drawAtPoint:withAttributes
method to draw string objects in a view. Then convert the content of the view into an UIImage object as discussed here.