最佳实践布局图像打印在WYSIWYG Mac应用程序? [英] Best Practice for laying out images for printing in a WYSIWYG Mac app?

查看:196
本文介绍了最佳实践布局图像打印在WYSIWYG Mac应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac应用程序的概念阶段,应该让用户轻松地选择和布局图像进行打印。这是一个基于文档的应用程序,文档可以有多个页面,大量的图片,不同的大小和旋转。 UI将类似于Pages.app的UI。

I'm in the concept phase of a Mac application that should let the user easily select and layout images for printing. It's a document-based app and a document can have multiple pages with lots of pictures in different sizes and rotations on it. The UI would kind of be like the UI of Pages.app.

这些图片可能是大的高分辨率图片。

Those pictures can possibly be large hi-res images. The user should also be able to print them in the best quality that the images offer.

我已经重新观看了关于Quartz,2D绘图优化和NSView的一些WWDC会议。

I have re-watched some WWDC sessions about Quartz, 2D drawing optimization and NSView.

我知道有几种不同的方法来完成我想做的事情,即:

I know that there are a few different ways of accomplishing what I want to do, namely:


  1. 使用页面的自定义视图,并使用Core Graphics / Quartz绘制 drawRect:中的图像。使用CG变换旋转和缩放图片。

  1. Use a custom view for a "page" and draw the images in drawRect: with Core Graphics/Quartz. Use CG transforms to rotate and scale images.

也可以使用自定义视图作为页面,但使用NSImageView-subviews显示图片。使用核心动画和图层转换来缩放/旋转图片。

Also use a custom view for a "page", but use NSImageView-subviews to display the images. Use Core Animation and layer transforms to scale/rotate images.

绘图与核心图形或使用NSViews?为什么?

What is the best practice for this? Drawing with Core Graphics or using NSViews? Why?

非常感谢!


  • Johannes

推荐答案

取决于这些页面的交互方式。如果存在大量的鼠标交互,例如拖动,选择等。我会与视图。如果你想要流畅的动画,我甚至使用纯CALayers的内容设置为一个图像。这也将让你z图像的位置,如果它们重叠。基于视图的解决方案使得z排序困难。
drawRect方法应该是最快的,但是你有困难的时间集成用户交互,你必须手动z顺序。

Depends on how interactive these pages should be. If there is a lot of mouse interaction, e.g. dragging, selecting etc. I'd go with views. If you want fluid animations I'd even use plain CALayers with their content set to one image. This would also let you zPosition the images in case they overlap. A view based solution makes z-ordering hard. The drawRect method should be fastest but you have hard times integrating user interaction and you must z-order manually.

这篇关于最佳实践布局图像打印在WYSIWYG Mac应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆