首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >打印截图-模糊图像

打印截图-模糊图像
EN

Stack Overflow用户
提问于 2013-02-01 20:59:05
回答 1查看 232关注 0票数 0

我有一些要打印截图的代码。问题是,默认的操作是用图像“填充”纸张,而不是“适合”图像,这会导致拉伸。在iphone的打印屏幕(如非视网膜)的情况下,它看起来很糟糕。

我找不到属性或任何打印图像的方法而不拉伸它,有人能帮上忙吗?

代码语言:javascript
复制
// print
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputPhoto;
printInfo.jobName = [NSString stringWithFormat:@"something")];
pic.printInfo = printInfo;

UIPrintFormatter *printFormatter = [[UIPrintFormatter alloc] init];
[printFormatter setMaximumContentHeight:image.size.height];
[printFormatter setMaximumContentWidth:image.size.width];
pic.printFormatter = printFormatter;

pic.printingItem = image; //low-res image
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-02 00:11:52

您可能需要设置contentInsets。使用UIEdgeInsets UIEdgeInsetsMake ( CGFloat top,CGFloat left,CGFloat bottom,CGFloat right );函数设置contentInsets。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14646862

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档