Hints needed about drawing lines and arcs



Hi all,

I am working on an application which needs to process16 bit greyscale
images.

The image is stored in a kind of raw buffer (actually an unsigned short
int*).  It is displayed by drawing it in a GdkPixmap* with
gdk_draw_gray_image after cutting the depth to 8 bits, then emitting an
"expose_event" for the gtk_drawing_area.  This event launches a callback
which transfers the pixmap to the drawing area gdk_window with
gdk_draw_pixmap.

I use GTK 1.2.X.

I want to draw lines and arcs of variable thickness in the 16 bits
buffer, without reinventing the wheel.

GDK offers some drawing primitives, but as I understand them, they allow
drawing in "drawables" like GDK pixmaps or windows, which are structures
on the X Server side.  I cannot easily, or at least efficiently,
retrieve the result of the drawing in the client side with the intent to
combine it with other client side images or to save it, for instance, in
a PNG file - or can I?  Furthermore, if I could, it wouldn't be a 16
bits image, or am I wrong?

Any advice on using GTK/GDK for this, or on any alternate solution,
would be welcomed.

Thanks in advance!

Patrice St-Gelais




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