DrawingArea help needed

Post Reply
bill-lancaster
Posts: 24
Joined: Tuesday 26th September 2017 3:17pm

DrawingArea help needed

Post by bill-lancaster » Monday 09th April 2018 1:03pm

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

User avatar
cogier
Site Admin
Posts: 179
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: DrawingArea help needed

Post by cogier » Monday 09th April 2018 4:17pm

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 23 times

User avatar
jornmo
Site Admin
Posts: 167
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo » Monday 09th April 2018 5:22pm


User avatar
cogier
Site Admin
Posts: 179
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: DrawingArea help needed

Post by cogier » Monday 09th April 2018 6:55pm

Unfortunately it doesn't tell you how to print the contents of a DrawingArea.

User avatar
jornmo
Site Admin
Posts: 167
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo » Monday 09th April 2018 8:24pm

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...

User avatar
jornmo
Site Admin
Posts: 167
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo » Monday 09th April 2018 8:26pm

And on a side note:
With cairo you can even draw to PDF or SVG: http://gambaswiki.org/wiki/comp/gb.cairo

vuott
Posts: 15
Joined: Wednesday 05th April 2017 6:07pm

Re: DrawingArea help needed

Post by vuott » Tuesday 10th April 2018 12:31am

cogier wrote:
Monday 09th 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

bill-lancaster
Posts: 24
Joined: Tuesday 26th September 2017 3:17pm

Re: DrawingArea help needed

Post by bill-lancaster » Friday 13th April 2018 7:50am

Thanks for all the suggestions - am happily printing and modifying drawing area

User avatar
jornmo
Site Admin
Posts: 167
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo » Saturday 14th April 2018 7:21am

:ugeek:

Post Reply