This article is for the translation of Cairo official tutorials
Original English Link: http://cairographics.org/tutorial/
Please correct me if there is any translation error.
Reprint please indicate the original link.
"It's under construction!" 】
Cairo Tutorials
This tutorial is from Michael Urman's Cairo tutorial for Python programmers. The original code snippet has been translated into C, where the necessary changes have been made.
Cairo is a powerful 2D graphics library. This article will show you how Cairo works and many people will use it to write graphical applications.
Here are a few things you need to do to work on your computer:
-
- Cairo body. You will need two libraries and a development file. If you don't have one, see download.
- A C compiler, the FAQ contains a small example of how to convert the code to produce the required output program.
If you want to see a snippet of the action included in this tutorial, you can try clicking on some pictures. You will get a short C program, which includes the drawing code described.
In addition, if you are challenging yourself, you can rewrite the sample code into your preferred language and your host environment and use only Cairo.
Note: the cairo_push_group () and Cairo_pop_group ()mentioned in the article. Requires at least Cairo 1.2.0 or more versions.
Directory
- The drawing model of Cairo
- Cairo drawing
- Preparing and selecting a signal source
- Create path
- Understanding text
- Transform work
- What's next?
- Tips and Tricks
- Line width
- Text alignment
The drawing model of Cairo
To explain the operations used by Cairo, we first dive into how a model draws the Cairo model. Only a few concepts are involved, which are then repeated through different methods. First, I'll describe the noun: destination, source, mask, path, and environment. After that, I'll introduce the methods it provides to manipulate the nouns and verbs that guide the graphics you want to create.
noun
Cairo nouns are more abstract. I want them to be more specific, including drawing how they interact with each other. The first three nouns you see in this section are three levels in the figure. The fourth noun, the path, is inhaled on the middle layer when it is relevant. The last noun, context, is not shown.
[In construction] Cairo Tutorials