Re: [gtk-list] Data conversion to Image



Hi, 

you might want to investigate using
	gdk_draw_rgb_image ()
which lets you draw a buffer directly to the screen ... it's 
a lot faster than using gdk_draw_point () ...

Greetings
--> R

> //Plot the image one pixel at a time
> for(x=0;x<XSIZE;x++)
>     for(y=0;y<YSIZE;y++)
>     {
>         int col = colorfunc(data[x][y]);        // Select which color
> from colmap to use for this pixel
>         // Set the foreground color
> 
> gdk_gc_set_foreground(style->dark_gc[GTK_STATE_NORMAL],colmap+col);
>         // Plot the point
> 
> gdk_draw_point(GTK_WIDGET(draw)->window,style->dark_gc[GTK_STATE_NORMAL],x,y);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]