How do I create shapes as in VB?

You need some new stunning features ? Tell us here.
Inertially
New User
New User
Posts: 9
Joined: Mon Nov 14, 2011 12:24 am

How do I create shapes as in VB?

Post 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
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: How do I create shapes as in VB?

Post by Polo »

You can only create PB gadgets. Don't know about VB!
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: How do I create shapes as in VB?

Post by Shield »

You could create your own routines using the canvas gadget.
Check the help. :)
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
USCode
Addict
Addict
Posts: 912
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle, USA

Re: How do I create shapes as in VB?

Post 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.
Inertially
New User
New User
Posts: 9
Joined: Mon Nov 14, 2011 12:24 am

Re: How do I create shapes as in VB?

Post 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?
luciano
Enthusiast
Enthusiast
Posts: 151
Joined: Wed Mar 09, 2011 8:25 pm

Re: How do I create shapes as in VB?

Post 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
Post Reply