drawables.



hi

I'm currently trying to make an application that retrieves an image
from, say, jpeg, and I would like to draw some lines on top of this
image.

I have found this snippet in the tutotial
(http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch15s06.html):

bool myarea::on_expose_event(GdkEventExpose* ev)
{
Glib::RefPtr<Gdk::PixBuf> image =
Gdk::PixBuf::create_from_file("myimage.png");
image->render_to_drawable(get_window(), get_style()->get_black_gc(),
0, 0, 100, 80, image->get_width(), image->get_height(), // draw the
whole image (from 0,0 to the full width,height) at 100,80 in the window
Gdk::RGB_DITHER_NONE, 0, 0);
return true;
}

It works. But I don't want to draw directly on the window, and every
example I find the gdk::drawable used is from get_window(). 

I don't understand why Gtk::DrawingArea is not gdk::drawable.
The question is what gtk-widget to use. Apparently only pixmap and
bitmap are gdk::drawable, but they are usuable for "offscreen"
rendering.

Help, pseudocode, links to examples would be much appreciated.

Regards
Morten Bo Nielsen




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