After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 547795 - Additional drawing documentation for book
Additional drawing documentation for book
Status: RESOLVED NOTABUG
Product: gtkmm
Classification: Bindings
Component: documentation
2.12.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-08-14 16:51 UTC by John Hobbs
Modified: 2009-01-07 21:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Additional text for book. (1.54 KB, patch)
2008-08-14 16:53 UTC, John Hobbs
none Details | Review

Description John Hobbs 2008-08-14 16:51:41 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.
Comment 1 John Hobbs 2008-08-14 16:53:04 UTC
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.
Comment 2 Murray Cumming 2008-10-20 11:44:22 UTC
But wouldn't you be using cairo(mm) to draw, so can't you just export something from a cairo context?
Comment 3 Murray Cumming 2008-11-10 12:35:12 UTC
Please respond.
Comment 4 John Hobbs 2008-11-10 15:32:36 UTC
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?
Comment 5 Murray Cumming 2008-11-10 16:29:55 UTC
What are you using to draw into the frame.ImageBuffer buffer?
Comment 6 John Hobbs 2008-11-10 16:48:24 UTC
It's coming off of cameras, both from V4L2 and other closed source ones, like Prosilica.
Comment 7 Murray Cumming 2008-11-10 17:01:47 UTC
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.
Comment 8 John Hobbs 2008-11-10 17:26:19 UTC
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.
Comment 9 Murray Cumming 2009-01-07 21:31:36 UTC
So there doesn't seem to be anything for us to do in the documentation. Please reopen if I have misunderstood.