Page 2 of 2

Re: Using DrawArea - Simplified

Posted: Tuesday 12th July 2022 7:24pm
by BruceSteers
seany wrote: Tuesday 12th July 2022 1:48pm Hi

PS: Is there a web repo of all available controls, made by community? Thank you
We have been discussing on the gambas mailing list about expanding the Farm to include modules/classes/components/controls/etc as well as whole gambas applications (Benoit included).

Benoit has a million things to do though so it may take a while but something is happening towards gambas having it's own list of community based custom things :)

This forum has a Component Showcase section but there is currently not a lot on it: viewforum.php?f=17

Re: Using DrawArea - Simplified

Posted: Wednesday 13th July 2022 5:24am
by Askjerry
Feel free to use anything I have created... I'm still learning.

If you know someone who has figured out the ADS1115 chip in Gambas... that would be incredibly helpful :-)

If you need me to zip up some files I can do that too.

Jerry

Re: Using DrawArea - Simplified

Posted: Wednesday 13th July 2022 6:17am
by vuott
seany wrote: Tuesday 12th July 2022 1:48pmIs there a web repo of all available controls, made by community?
I suggest you also search the currently existing international forums of Gambas programmers.

Re: Using DrawArea - Simplified

Posted: Saturday 23rd July 2022 2:44am
by Askjerry
When I read through the documentation, it said the PAINT functions could be used in a DRAWINGAREA and/or the following..
  • Picture
  • Image
  • DrawingArea
  • Printer
  • SvgImage

DRAWINGAREA works great... I make a PICTUREBOX and load in the SVG image... then I create a DRAWINGAREA and place it over the PICTUREBOX... think a sheet of glass laid on top of an image... then I can draw on it. But if I just create a PICTUREBOX and try to PAINT directly on it... I get errors.

Any ideas?

I mean for now... I'll keep dropping a DRAWINGAREA over the PICTUREBOX(s). I could have an array of them, with a single DRAWINGAREA over them all... then just adjust my math to draw where I like. I was just curious if someone got code working to do it without two separate layers.

Re: Using DrawArea - Simplified

Posted: Saturday 23rd July 2022 5:09pm
by vuott
Do you mean that, if you use Class Paint directly with PictureBox, you get errors?

Re: Using DrawArea - Simplified

Posted: Saturday 23rd July 2022 6:46pm
by Askjerry
If I create a DRAWINGAREA and paste some code on it... it works.

If I create a PICTUREBOX, then paste the exact same code... fails.

Re: Using DrawArea - Simplified

Posted: Saturday 23rd July 2022 7:29pm
by vuott
I don't know if I have understood correctly; however, as you yourself reported (viewtopic.php?p=5889#p5889), it is not possible to use the Paint Class directly with a PictureBox.
So, you will need to use Paint with an Object of type "Image" or "Picture" (by using Paint.Begin() Method), and then load this Object into the PictureBox.

Re: Using DrawArea - Simplified

Posted: Saturday 23rd July 2022 9:21pm
by Askjerry
Ok, I'll stick with DRAWINGAREA... it works and doesn't take much effort to drop in as an overlay.

Thanks,
Jerry

Re: Using DrawArea - Simplified

Posted: Sunday 24th July 2022 9:39am
by BruceSteers
PictureBox is just not in the list of things Paint can operate on but the Picture it contains IS paintable so you must work on the picture not the PictureBox then set the PictureBox.Picture to your edit.

This will operate on a PictureBox.

it loads huge/color icon then superimposes the gambas icon on it.
then makes it the picturebox picture

Public pPic As Picture

Public Sub Button1_Click()

  pPic = Picture["icon:/huge/color"]

  Paint.Begin(pPic)
    Dim p As Picture = Picture["icon:/small/gambas"]
    Paint.DrawPicture(p, 10, 10, p.W, p.H)
  Paint.End

PictureBox1.Picture = pPic

End



Re: Using DrawArea - Simplified

Posted: Sunday 24th July 2022 2:16pm
by Askjerry
BruceSteers... I'll tinker with this.
Thank you!