我已经努力使用石英组合物绘制某些3D图和表面。在我的(Cocoa)应用程序的QCView中,一切都很精彩。但是,为了打印,我正在拍摄QCView的快照来生成NSImage,并在“我的打印选项”屏幕中将其放在NSView中。但是,快照中的线条和颜色看起来可怕的别名。是否有另一种方式从我的QCVIEW直接打印,或绕过/覆盖拍摄快照,以便NSImage看起来像我的QCView中的内容一样好?QCView继承自NSView,但内置打印方法似乎没有工作。

谢谢!

有帮助吗?

解决方案 2

Thanks smokris, but I found that the way to do this is to take a CGImage snapshot. I thought I'd be able to put this snapshot in an IKImageView, which preserves anti-aliasing, but IKImageView suffers from the same issue QCView, in that when print is called you get nothing in your print window.

So, the method that finally worked is to create pdf data from the CGImage snapshot using a CGPDFContext, load up an NSImageView with an NSImage generated from this pdf data, and when this goes to a print window all anti-aliasing is preserved! Very roundabout, but works like charm!

其他提示

The obliteration of antialiasing might have something to do with alpha-transparency. As the lowest layer in your Composition, do you have a Clear patch set to opaque black? (It defaults to transparent black, which might be causing the problem here.)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top