File:Cairo example.svg

From Wikimedia Commons, the free media repository

Jump to: navigation, search

Cairo_example.svg(SVG file, nominally 125 × 125 pixels, file size: 25 KB)

[edit] Summary

Description

This is an example with a german label "Hallo Wikipedia!"

Date

15 May 2008(2008-05-15)

Source

own sourcecode, compile with gcc cairo.c `pkg-config --cflags --libs cairo` and execute it.

#include <cairo.h>
#include <stdio.h>
 
int main(int argc, char **argv) {
    cairo_t *cr;
    cairo_surface_t *surface;
    cairo_pattern_t *pattern;
    cairo_text_extents_t text;
    int x,y;
 
    surface = (cairo_surface_t *)cairo_svg_surface_create("beispiel.svg", 100.0, 100.0);
    cr = cairo_create(surface);
 
    /* Quadrate im Hintergrund zeichnen */
    for (x=0; x<10; x++)
       for (y=0; y<10; y++)
           cairo_rectangle(cr, x*10.0, y*10.0, 5, 5);
 
    pattern = cairo_pattern_create_radial(50, 50, 5, 50, 50, 50);
    cairo_pattern_add_color_stop_rgb(pattern, 0, 0.75, 0.15, 0.99);
    cairo_pattern_add_color_stop_rgb(pattern, 0.9, 1, 1, 1);
 
    cairo_set_source(cr, pattern);
    cairo_fill(cr);
 
    /* Schrift im Vordergrund */
    cairo_set_font_size (cr, 15);
    cairo_select_font_face (cr, "Georgia",
        CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
    cairo_set_source_rgb (cr, 0, 0, 0);
 
    cairo_move_to(cr, 10, 25);
    cairo_show_text(cr, "Hallo");
 
    cairo_move_to(cr, 10, 75);
    cairo_show_text(cr, "Wikipedia!");
 
    cairo_destroy (cr);
    cairo_surface_destroy (surface);
    return 0;
}
Author
This file was made by User:Sven
Nuvola apps locale.png
Translation

If this image contains text, it can be translated easily into your language. If you need help, contact me

SemiPD-icon.svg
Flexible licenses

If you want to use this picture with another license than stated below, contact me

Nuvola apps email.png
Contact the author

If you need a really fast answer, mail me. If you need only a fast answer, write me here.

Permission
(Reusing this image)

it's quite stupid, so see it as public domain:

Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Azərbaycan | Беларуская (тарашкевіца) | Български | Català | Cebuano | Soranî / کوردی | Česky | Cymraeg | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | Estremeñu | فارسی | Suomi | Français | Galego | עברית | हिन्दी | Hrvatski | Magyar | Հայերեն | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Ripoarisch | Kurdî / كوردی | Latina | Lietuvių | Latviešu | 文言 | Македонски | Bahasa Melayu | Plattdüütsch | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Vèneto | Tiếng Việt | Walon | 吴语 | 中文 | ‪中文(简体)‬ | ‪中文(繁體)‬ | 粵語 | +/−

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current01:56, 15 May 2008Thumbnail for version as of 01:56, 15 May 2008125×125 (25 KB)Sven (Talk | contribs) ({{Information |Description=This is a stupid example with a german label "Hallo Wikipedia!" |Source=own sourcecode, compile with <code>gcc cairo.c `pkg-config --cflags --libs cairo`</code> and execute it. <source lang="c"> #include <string.h> #include <ca)

The following page links to this file:

Global file usage

The following other wikis use this file: