Page 1 of 1

DrawingArea help needed

Posted: Monday 9th April 2018 1:03pm
by bill-lancaster
I have a programme that draws a chart in a drawingarea using paint.begin etc.
How can I clear the drawingarea for a different form of chart.
drawingarea.clear doesn't do it and I can't see a paint method.

Also,is there a convenient way to print the drawingarea image to a printer?

Any advice would be appreciated

Re: DrawingArea help needed

Posted: Monday 9th April 2018 4:17pm
by cogier
Have a look at the attached example that draws and clears a DrawingArea.

Have a look at ChartExample in the Gambas Farm, that uses a DrawingArea but no drawing is needed.

I'm not sure about printing yet!

Let us know how you get on.
Drawing.tar.gz
(12.92 KiB) Downloaded 562 times

Re: DrawingArea help needed

Posted: Monday 9th April 2018 5:22pm
by jornmo

Re: DrawingArea help needed

Posted: Monday 9th April 2018 6:55pm
by cogier
Unfortunately it doesn't tell you how to print the contents of a DrawingArea.

Re: DrawingArea help needed

Posted: Monday 9th April 2018 8:24pm
by jornmo
As you paint to the DrawingArea you simultaneously draw to the printer, or you can draw to an image, and draw the image to the drawingarea and the printer...

Re: DrawingArea help needed

Posted: Monday 9th April 2018 8:26pm
by jornmo
And on a side note:
With cairo you can even draw to PDF or SVG: http://gambaswiki.org/wiki/comp/gb.cairo

Re: DrawingArea help needed

Posted: Tuesday 10th April 2018 12:31am
by vuott
cogier wrote: Monday 9th April 2018 6:55pm Unfortunately it doesn't tell you how to print the contents of a DrawingArea.
I suggest this Wiki page of italian forum:

http://www.gambas-it.org/wiki/index.php ... rawingArea

Re: DrawingArea help needed

Posted: Friday 13th April 2018 7:50am
by bill-lancaster
Thanks for all the suggestions - am happily printing and modifying drawing area

Re: DrawingArea help needed

Posted: Saturday 14th April 2018 7:21am
by jornmo
:ugeek: