You are not logged in.

#1 2012-01-13 11:09:27

MohammadR
Member
Registered: 2010-07-02
Posts: 23
Website

gtk draw a colored point

hello all

i want to draw a pixel on window with a rgb color and this is my code :

            GdkColor color ;
            color.blue = 40 ;
            color.red = 100 ;
            color.green = 50 ;
            gdk_gc_set_rgb_fg_color (widget->style->black_gc, &color);
            gdk_draw_point( widget->window , widget->style->black_gc  ,10 ,10);

but color of drawing is still black !

what should i do ? thanks ...

Offline

#2 2012-01-13 14:40:22

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: gtk draw a colored point

I have no experience with GDK, but from GdkColor's documentation I think you should multiply your blue, red and green values by 256.

Offline

Board footer

Powered by FluxBB