Page 1 of 1

How do I create shapes as in VB?

Posted: Fri Aug 23, 2013 4:35 pm
by Inertially
VB has shape controls such as circle, rectangle, where you can change the background color, border-width, border-style, rounded corner rectangle etc.

Is there a way to get that control in PB?

Or do I have to Make my entire form a WebGadget and just make all my controls in HTML/CSS/JS

Re: How do I create shapes as in VB?

Posted: Fri Aug 23, 2013 4:46 pm
by Polo
You can only create PB gadgets. Don't know about VB!

Re: How do I create shapes as in VB?

Posted: Fri Aug 23, 2013 4:58 pm
by Shield
You could create your own routines using the canvas gadget.
Check the help. :)

Re: How do I create shapes as in VB?

Posted: Fri Aug 23, 2013 7:12 pm
by USCode
As was noted above, you could use the Canvas gadget and draw on it using the 2DDrawing library.
The 2DDrawing library has the shapes you mentioned plus lots of other drawing functions, including gradients.
In addition to a canvas, the 2DDrawing library also allows you to draw on a window, screen, sprite, image, texture or printer.

Re: How do I create shapes as in VB?

Posted: Sat Aug 24, 2013 5:41 am
by Inertially
Doesn't seem that suitable.

Drawing and text looks really pixelated.
Is there a way to change the font in DrawText?

And to make something clickable (make the shape a button), I would have to map mouse coordinates?

Re: How do I create shapes as in VB?

Posted: Sat Aug 24, 2013 8:44 am
by luciano
You could use png with alpha transparency if you want odd shaped buttons.
Rectangular buttons with rounded corners should not require a map for mouse click.

PNGs with alpha transparency made in a graphic application look very good in a form.

You could take some ideas from this simple example at:
http://www.purebasic.fr/english/viewtop ... 40&t=56149