How to Create Cloud shape?

In Vb you can create the standard Shapes  Rectangle,Square,Circle,Rounded Rectangle,Rounded Square.

How to create a  Cloud shape?
srinivasan042598Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shaverCommented:
Here is how to show a cloud shape on a VB Form:

Open up the program Paint.  (This program should be under the accessories portion of the Start menu)

In Paint draw a cloud (or any other shape you want to create) and save it as cloud.bmp.

Next, in VB double click the picture box control.  Show the proporties box of the picture box you created.  Under "Picture" goto the directory of cloud.bmp.  Now there is a cloud in the picture box.

If you have any questions at all, feel free to ask.
Regards,
Luke
0
srinivasan042598Author Commented:
My question is not inserting picture. I would like to have a cloud shape similar to the standard shapes like  Rectangle,Square,Circle,Rounded Rectangle,Rounded Square.
0
dufortCommented:
Do you want your cloud to be drawn at any size? To be any color (fill & outline)? To be filled or outlined depending on a parameter? To be a simple procedure taking a PictureBox as one of its parameters, or to be an ExtendedPictureBox new class?

Depending on your answer, there are different options available.

Please give me more information, and I will help you.

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

srinivasan042598Author Commented:
Yes, I would like to draw any size,color like standard shape.
I consider  Cloud also as shape(or object.) i.e., it is rectangle with arcs (not straight line).
Is my assemption correct?  Is it possible?
If you could help me giving some code to construct the shape, I would be grateful.

TIA

srinivasan
0
lbkCommented:
You might want to consider writing a user control with appropriate properties, then draw the cloud using Line, Circle, etc methods of the custom control and setting it's backstyle property to transparent.
0
srinivasan042598Author Commented:
I am new to VB. Will it be possible to give a sample code ?

TIA

srinivasan
0
EvanLCommented:
The best way to draw a cloud in VB without using any other drawing program is to draw 7-10 ovals and circles of the same color and fill and position them all together.  A cloud is nothing more than a bunch of circular shapes.  Try it - it works!
0
srinivasan042598Author Commented:
I would like have a cloud object not to draw cloud.
Mr.  lbk suggestion is OK. Since I am new to VB, I would really appreciate if some gives me some code.

Even  if  some one suggest some other shape/object
(i.e. Triangle) is also welcome
0
zsiCommented:
Since you are new and do not want to go through the hassle of drawing a cloud (which can get rather complex), I suggest this:

Find a clipart object (it's file format should be .wmf) and load it into a picture box.  You can then manipulate the picture box anyway that you want with regards to size.  The clipart format (properly known as Windows Meta File) is especially good for resizing.  There are many (free) resources on the Net for cliparts.  Just take a look through Yahoo.

Hope this helps!

zsi
0
srinivasan042598Author Commented:
As I previously stated , I am not interested  in manupulating  picture box. I would like to have a cloud shape similar to the standard shapes like  Rectangle,Square,Circle,Rounded Rectangle,Rounded Square.  
0
zsiCommented:
srinivasan,

There is no such thing as a cloud shape.  However, since you do not want to use a picture box (I assume you do not want the overhead of using an additional Windows' handle), then try one of these two methods:

Either
 1) Create (or filch) a cloud metafile and draw it to your form using the DrawMetafileEx API command and put the code in the form_paint method or
 2) Just draw the thing yourself using either the form's drawing methods or the API's drawing functions.

Either way, these are your only alternatives if you do not want to use a picturebox or some similar heavy-weight control.

zsi
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zsiCommented:
It occurred to me that you might not understand what the stock VB shapes are.

Simply put, they are macros that get called each time the VB form is painted.  While it may seem as if they are controls, they aren't.  They do not have handles, have no events or methods, and do not permanently use up any Windows resources.  Because of this, they are what is referred to as a light-weight control.

Each time VB paints or redraws your form, it simply draws a circle, or sqaure, or whatever else is defined by that shape control.  However, they do not support user-defined shapes.
The reason for this is that VB simply executes the drawing commands based on the parameters that you set on the shape.

Hopefully, this explanation will help you to understand what the shape 'control' is and, if you want something different, why you have to do it yourself.

zsi
0
dufortCommented:
The meta-file thing seems a good idea. A user could draw a scaled meta-file anywhere. It's scalable and transparent.

By the way, this means that your cloud shape would be "static" (no color change, no shape change). But who's patient enough to design an object that takes nodes and draws a "custom" cloud afterwards? For that, you would need an entire nodes-editing tool. And filling it is out of the question. Far too complicated.

What about stating that a cloud is a set of filled circles? Simply design an object keeping an array of circles data and the color, and call this object for repainting.

0
srinivasan042598Author Commented:
Mr Zsi, Thank you for your clarification,suggestion and explanation.

Mr. dufort, Thank you for help for further clarification

Kind Regards,

srinivasan
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.