<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello, I'm begining with cairo with a very simple
program that doesn't work, but I don't understand why !!!</FONT></DIV>
<DIV><FONT face=Arial size=2>Here is the code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2>
<P>#include <cairo-win32.h></P>
<P>#define WIDTH 10000</P>
<P>#define HEIGHT 10000</P>
<P>void display_status(cairo_status_t status) {</P>
<P>switch(status) {</P>
<P>case CAIRO_STATUS_SUCCESS:</P>
<P>cout << "CAIRO_STATUS_SUCCESS" << endl;</P>
<P>break;</P>
<P></P>
<P>case CAIRO_STATUS_NULL_POINTER:</P>
<P>cout << "CAIRO_STATUS_NULL_POINTER" << endl;</P>
<P>break; </P>
<P></P>
<P>case CAIRO_STATUS_NO_MEMORY:</P>
<P>cout << "CAIRO_STATUS_NO_MEMORY" << endl;</P>
<P>break; </P>
<P></P>
<P>case CAIRO_STATUS_READ_ERROR:</P>
<P>cout << "CAIRO_STATUS_READ_ERROR" << endl;</P>
<P>break;</P>
<P></P>
<P>case CAIRO_STATUS_INVALID_CONTENT:</P>
<P>cout << "CAIRO_STATUS_INVALID_CONTENT" << endl;</P>
<P>break;</P>
<P></P>
<P>case CAIRO_STATUS_INVALID_FORMAT:</P>
<P>cout << "CAIRO_STATUS_INVALID_FORMAT" << endl;</P>
<P>break;</P>
<P></P>
<P>case CAIRO_STATUS_INVALID_VISUAL:</P>
<P>cout << "CAIRO_STATUS_INVALID_VISUAL" << endl;</P>
<P>break;</P>
<P>}</P>
<P>}</P>
<P></P>
<P>int main(int argc, char** argv) {</P>
<P>cairo_surface_t *surface;</P>
<P>cairo_t *cr;</P>
<P></P>
<P>surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, WIDTH, HEIGHT);
</P>
<P>display_status(cairo_surface_status (surface));</P>
<P></P>
<P>cr = cairo_create (surface);</P>
<P>display_status(cairo_surface_status (surface)); </P>
<P></P>
<P>cairo_set_source_rgb(cr, 1,1,1);</P>
<P>cairo_fill(cr);</P>
<P>display_status(cairo_surface_status (surface));</P>
<P></P>
<P>cairo_surface_write_to_png (surface, "test.png"); </P>
<P>display_status(cairo_surface_status (surface));</P>
<P>cairo_destroy (cr);</P>
<P>cairo_surface_destroy (surface);</P>
<P>return 0;</P>
<P>}</P>
<P> </P>
<P><FONT face=Arial>The program create a png image, but it's filled in black
whereas it should be white. I tried to draw paths and other forms but it seems
that the image buffer isn't </FONT></P>
<P><FONT face=Arial>modified. I'm working on Windows with DevC++ and use the
cairo library provided with the GTK+ package for windows as indicated on the
Cairo web site. </FONT></P>
<P><FONT face=Arial>So, do you know why this code doesn't work ?</FONT></P>
<P><FONT face=Arial>Thanks</FONT></P>
<P><FONT face=Arial></FONT> </P>
<P><FONT face=Arial>PS: sorry for my English, I'm french :-)
</FONT></P></FONT></DIV></BODY></HTML>