Programowanie w systemie UNIX/c grafika/cairo: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Linia 18:
<source lang=c>
/*
https://www.cairographics.org/FAQ/
http://zetcode.com/gfx/cairo/cairobackends/
the first example,
it will create a PNG image.
© 2007 - 2016 Jan Bodnar
gcc c.c $(pkg-config --cflags --libs cairo)
./a.out
Linia 28:
#include <cairo.h>
 
int main(void)
main (int argc, char *argv[])
{
cairo_surface_t *surface; =
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 390240, 6080);
cairo_t *cr; =
cr = cairo_create (surface);
 
cairo_select_font_face (cr, "Sansserif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 390, 60);
cairo_set_font_size (cr, 4032.0);
cr = cairo_create(surface);
cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
cairo_move_to (cr, 10.0, 50.0);
cairo_show_text (cr, "Disziplin istHello, Macht.world");
 
cairo_destroy (cr);
cairo_set_source_rgb(cr, 0, 0, 0);
cairo_surface_write_to_png (surface, "imagehello.png");
cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
cairo_surface_destroy (surface);
CAIRO_FONT_WEIGHT_NORMAL);
return 0;
cairo_set_font_size(cr, 40.0);
 
cairo_move_to(cr, 10.0, 50.0);
cairo_show_text(cr, "Disziplin ist Macht.");
 
cairo_surface_write_to_png(surface, "image.png");
 
cairo_destroy(cr);
cairo_surface_destroy(surface);
 
return 0;
}
</source>