[Gambas-user] drawingarea - clipping when saving to file

Björn Röder paratinto at ...467...
Tue May 12 00:43:40 CEST 2009


Hello everyone!

First of all, Gambas is a really great piece of software that I really
enjoy to use. I am using it as my default programming language for
practical laboratory tool development. Nevertheless I got stuck while
programming a tool for simple image analysis and editing of scanned data.

I am experiencing problems when I am trying to save a Drawingarea to a
file. I have loaded a scanned picture inside the Drawingarea. The
Drawingarea itself is placed inside a Scrollview.

Hierarchy: Form(Scrollview(Drawingarea(JPEG-Image + drawn lines)))

I am using the following code to save the Drawingarea:

Drawingarea.grab().image.save("/home/user/test.jpg")

When the area of the image is greater than the scrollview (when
scrollbars are visible), only the visible part of the screen is saved
correctly. The rest of the Drawingarea's content is filled with bogus
image-parts (e.g. parts of surrounding Dektop and Form, where the hidden
Image-part should be).

The problem is discussed in a forum regarding Motif-programming (*), but
I haven' t found any similar information for Gambas.
(* Link:
http://fixunix.com/motif/93849-saving-drawingarea-xpm-xcopyarea.html)

Thank you for your interest and help!

Regards,

Björn




More information about the User mailing list