Quartz 2D Official document translation (ongoing update)

Source: Internet
Author: User

Transformation
The core drawing model defines two fully independent coordinate spaces: User space, one representing the document page, and the device space, and the other representing the resolution of the native device. User-space coordinates are floating-point numbers that are independent of the pixel resolution in device space. When you want to print or display your document, the user space coordinates in Quartz maps are automatically converted to device space coordinates. Therefore, you never have to rewrite your application, or write down additional code to tweak the output of your application on different devices.

You can do this by modifying the default user space or CTM on the current transformation matrix, and after you create a graphics context, CTM is the unit matrix. You can modify the CTM using the quartz conversion function to get a result that modifies the user space drawing.

This chapter:
* Provides an overview that you can use to perform conversion functions
* Explains how to modify CTM
* Describes how to create an affine transform
* Explains how to determine that two conversions are equivalent
* Describes how to get user-to-device space conversion
* Discuss affine transformations in mathematics

About the core Drawing transformation feature
You can easily know that with the quartz 2D built-in conversion function, you can scale and rotate your drawing with just a few lines of code, and you will be able to apply these transformations to any order and any combination. Figure 5-1 illustrates the effect of zooming and rotating an image. Each conversion you apply is used to update CTM. CTM always represents a mapping between user space and device space, and this mapping ensures that the output of the application on any display screen or printer is good.

Figure 5-1 Applying scaling and rotation

The core drawing API provides five features that allow you to get and modify CTM, you can rotate, pan, and zoom CTM. And you can also connect an affine transformation matrix and CTM to see the modification of the current transformation matrix.

Quartz 2D Official document translation (ongoing update)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.