我的照片打印机返回的像素尺寸为 448 x 295。在打印机选项中,我可以看到分辨率为 2152 x 1416(6 x 4 英寸),如果我将精灵设置为 2152 x 1416,它会很大。
如何提供正确比例/DPI 的精灵?
我已经尝试过:
_printOptions = new PrintJobOptions();
_printOptions.pixelsPerInch = 346;
但给出:错误#1056:无法创建属性 pixelsPerInch
更新:
因此,正如 Khaled Garbaya 下面提到的,请确保项目设置为使用 AIR 2,设置 DPI 选项,将位图数据设置为 2152 x 1416,并将其作为子项添加到设置为 448 x 295 的精灵中,点击打印,效果非常好。
My photo printer returns a pixel dimensions of 448 x 295. In the printer options I can see that the resolution is 2152 x 1416 (for 6 x 4 inch), If I set my sprite to 2152 x 1416 it comes out way to big.
How do I provide a Sprite at the right scale / DPI?
I have tried:
_printOptions = new PrintJobOptions();
_printOptions.pixelsPerInch = 346;
But gives: Error #1056: Cannot create property pixelsPerInch on flash.printing.PrintJobOptions
UPDATE:
So as Khaled Garbaya mentions below make sure the project is set to use AIR 2, set the DPI option, have the bitmapData at 2152 x 1416, and add as a child to a sprite which is set at 448 x 295, hit print and comes out great.
发布评论
评论(1)
确保您的项目设置为在 AIR 2 或以上版本上运行并确保设置您将用于打印到公共的 movieClip 属性
Make sure your projet is set to run on AIR 2 or plus And make sure to set the movieClip properties that you will use to print to public