GNOME Bugzilla – Bug 547795
Additional drawing documentation for book
Last modified: 2009-01-07 21:31:36 UTC
I recently had the mailing list solve a real bugger of a problem for me in extracting images I had just drawn to a file. I think that would make a good addition to the book. I wrote a sample section for the gtkmm-tut.xml and will attach the patch, not sure if the writing is up to snuff however.
Created attachment 116586 [details] [review] Additional text for book. I do not know if it is placed appropriately in the documentation or if the formatting and writing style are suitable, I just tried to mimic other sections.
But wouldn't you be using cairo(mm) to draw, so can't you just export something from a cairo context?
Please respond.
I sometimes draw images directly (for good or bad) from data onto the drawing area, with something like: drawingArea.get_window()->draw_rgb_image( drawingArea.get_style()->get_bg_gc(Gtk::STATE_NORMAL), 0, 0, frame.Width, frame.Height, Gdk::RGB_DITHER_NONE, (const guchar*) frame.ImageBuffer, frame.Width*3 ); Would a better solution be to hold onto that buffer data somewhere else?
What are you using to draw into the frame.ImageBuffer buffer?
It's coming off of cameras, both from V4L2 and other closed source ones, like Prosilica.
If you are just using that image without modification, I do think you should just store it elsewhere rather than using the GUI as your cache. But that's just personal preference, and maybe that would cause massively inefficient data copying. I also wonder if a cairo context has a way to draw an image. Then we should be using cairo to get the image back again. The gdk_draw_*() functions are generally deprecated, I think.
That sounds reasonable. I have found a way to load a pixbuf into Cairo, see http://kapo-cpp.blogspot.com/2008/01/drawing-pixbuf-to-cairo-context-2.html for that.
So there doesn't seem to be anything for us to do in the documentation. Please reopen if I have misunderstood.