GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

multiple rectangles in cairo?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
TriKri
Familiar Face


Joined: 19 Mar 2008
Posts: 14

PostPosted: Thu Mar 20, 2008 5:38 pm    Post subject: multiple rectangles in cairo? Reply with quote

Hello,

I Have a little problem concerning cairo and rectangles. I want to draw multiple rectangles (without borders) in different colors, but when cairo is finished drawing, all rectangles have the same color as I specified the last rectangle to have. After closing a path I run
Code: (Plaintext)
1
2
cairo_set_source_rgb(cr, red, green, blue);
cairo_fill_preserve(cr);

where *cr is the cairo rectangle to draw in. The variables red, green and blue have different values each time the rectangle is drawn. Do I have to create a new layer or something, to be able to have more colors at once? Or do I have to use another function than cairo_set_source_rgb?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP