Cairo Study Notes

Source: Internet
Author: User
Tags cairo

Cairo is a 2D graphics library that supports multiple output devices. Currently supported output targets include X Window System, quartz, Win32, image buffers, postscript, PDF, and SVG.

The following describes the Cairo Plot Model. The first is the most important three concepts in the model: source, mask, and destination. The simple idea is that the source will use the mask filter to draw on our output device (destination.

Source is a drawing board or pen or ink used for drawing. It can be used for drawing and filling. There are four types of Source: colors, gradients, patterns, and images.

 

The bottom destination is a surface, a device to be output, a window, a PDF, SVG, and so on. So what we need to do is to use the verb to construct a suitable mask.

Mask is used as a filter. The mask is used to determine which parts of the source can be applied to destination and which cannot be used on destination.

All the three layers correspond to a context. Context contains the State data of all graphs (such as the width, color, surface to draw, and others, which allows the plotting function to draw with a few parameters ). The opaque part on the mask layer can be applied to destination, but the transparent part is not.

These "verbs" include stroke and fill. Stroke allows the source near the path to pass through the mask. Fill allows the elements in the path to pass through the mask. (The stroke operation draws the outlines of shapes and the fill operation fills the insides of shapes.) other verbs include painting, mask, and showtext.

 

For more information, see here: http://www.cairographics.org/tutorial/

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.