Albrecht Schlosser wrote:

> Albrecht Schlosser wrote:
> 
> There's a minor typo in capture_v2.cxx, as posted previously:
> 
>     // Pack a Fl_RGB_Image and force its dtor to do the cleanup
>     Fl_RGB_Image *rgb_img = new
> Fl_RGB_Image(offscreenImage,xdim-x(),ydim-y(),3);
> 
> should read: "...(offscreenImage,xdim,ydim,3);
> 
> but since x() and y() are 0, this doesn't really matter.
> 
> Also, there are some unneeded header files included...
> 
> Albrecht

Many thanks Albrecht! I just posted by solution and it appears to be 
basically the same as yours which is good for me since verifies to myself 
that I have understood (hopefully;))

>From what I can tell, the only difference between my implementation and 
yours is that you make your Fl_Offscreen slightly larger than what is needed 
then then use fl_read_image() to copy out only the portion for the final 
Fl_RGB_Image. To get around this, I implemented a 
Fl_Canvas::children_bbox(X,Y,W,H) which iterates through the children and 
creates a bounding box the encompasses all the children. Using the W and H 
of the children's bounding box, I was able to create a Fl_Offscreen that is 
the same size as the resulting Fl_RGB_Image. Also, I had to temporarily 
reposition the children to (0,0) which I guess effectively is "same" thing 
as you did.

In the end, I believe both implementations are valid just there are many 
ways to cook a steak :)

Thank you very much for your help with this. It is greatly appreciated!

Alvin

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to