DrawingArea help needed

Post your Gambas programming questions here.
Post Reply
bill-lancaster
Posts: 190
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

DrawingArea help needed

Post 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
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: DrawingArea help needed

Post 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 560 times
User avatar
jornmo
Site Admin
Posts: 224
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo »

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

Re: DrawingArea help needed

Post by cogier »

Unfortunately it doesn't tell you how to print the contents of a DrawingArea.
User avatar
jornmo
Site Admin
Posts: 224
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post 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...
User avatar
jornmo
Site Admin
Posts: 224
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo »

And on a side note:
With cairo you can even draw to PDF or SVG: http://gambaswiki.org/wiki/comp/gb.cairo
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: DrawingArea help needed

Post 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
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
bill-lancaster
Posts: 190
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: DrawingArea help needed

Post by bill-lancaster »

Thanks for all the suggestions - am happily printing and modifying drawing area
User avatar
jornmo
Site Admin
Posts: 224
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: DrawingArea help needed

Post by jornmo »

:ugeek:
Post Reply