Cairo FAQ Introduction

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
(Новая: Welcome to the Cairo graphics tutorial. This tutorial will teach you basics and some advanced topics of the Cairo 2D vector drawing library. In most examples we will use the GTK+ program...)
(Удалено по требованию автора...)
 
Строка 1: Строка 1:
-
Welcome to the Cairo graphics tutorial. This tutorial will teach you basics and some advanced topics of the Cairo 2D vector drawing library. In most examples we will use the GTK+ programming library.
 
-
This tutorial is done in C programming language.
 
-
 
-
== 2D Vector Graphics ==
 
-
 
-
There are two different computer graphics. <b>Vector</b> and <b>raster</b> graphics.
 
-
Raster graphics represents images as a collection of pixels. Vector graphics is the use of geometrical primitives such as points, lines, curves or polygons to represent images. These primitives are created using mathematical equations.
 
-
 
-
Both types of computer graphics have advantages and disadvantages. The advantages of vector graphics over raster are:
 
-
 
-
* smaller size
 
-
* ability to zoom indefinitely
 
-
* moving, scaling, filling or rotating does not degrade the quality of an image
 
-
 
-
== Cairo ==
 
-
 
-
Cairo is a library for creating 2D vector graphics. It is written in the C programming language. Binding for other computer languages exist. Python, PERL, C++, C#, Java. Cairo is a multiplatform library, works on Linux, BSDs, OSX.
 
-
 
-
Cairo supports various backends.
 
-
 
-
* X Window System
 
-
* Win32 GDI
 
-
* Mac OS X Quartz
 
-
* PNG
 
-
* PDF
 
-
* PostScript
 
-
* SVG
 
-
 
-
This means, we can use the library to draw on windows on Linux/BSDs, Windows, OSX and we can use the library to create PNG images, PDF files, PostScript files and SVG files.
 
-
 
-
We can compare the cairo library to the <b>GDI+</b> library on Windows OS and the <b>Quartz 2D</b> on Mac OS.
 
-
Cairo is an open source software library. From version 2.8, the cairo library is part of the <b>GTK+</b> system.
 
-
 
-
== Compiling exampes ==
 
-
 
-
The examples are created in the C programming language. We use GNU C compiler to compile them.
 
-
 
-
<source lang="cpp">
 
-
gcc -o example `pkg-config --cflags --libs gtk+-2.0` example.c
 
-
</source>
 
-
 
-
[[Категория:GTK+]]
 
-
[[Категория:Cairo]]
 

Текущая версия на 11:29, 7 апреля 2009