|
-
Jan 4th, 2002, 03:59 AM
#1
Thread Starter
Addicted Member
Drawing on a form
Hi,
I want to create my own Controls by using API calls. I have some lil' experience with creating controls from building further on an exsiting control. Is there a tutorial on how to draw these things from scratch? I mean not by using an existing control but just take an empty form and draw all the lines.
Thnx
Sand Hawk
- We wish to assimilate more information.
-
Jan 4th, 2002, 04:57 AM
#2
Frenzied Member
All drawing, whether on a form or a control, is performed on the given window's device context .
You can get a handle to this device context (e.g Form.HDC) and pass that to the large number of drawing functions that take this as one of their parameters.
For example, if you wanted a control that looked like a frame, you could use the DrawEdge method or to paint a picture onto the control you could use the BitBlt method.
HTH,
Duncan
-
Jan 4th, 2002, 05:08 AM
#3
Thread Starter
Addicted Member
Can you point me to a tut that explains this is a simple matter? I have done so GDI drawing with C++ but I want some more explanation about it in VB.
Thnx
Sand Hawk
-
Jan 4th, 2002, 05:18 AM
#4
Frenzied Member
Drawing in VB (other than by using the intrinsic controls) uses exactly the same API calls as drawing using GDI in C++.
The only difference is that you have to explicitly import (declare) those functions and their associated constants before you can use them.
I have done this in the EventVB.dll for simplicity sake - see the link under "device context" in the above post. However if you do not wish to use a third party dll then you can find most of the function declarations in the API Function Loader applet that comes with VB.
-
Jan 4th, 2002, 07:05 AM
#5
Go to www.allapi.net
There are several examples of using GDI on forms.
Go into api list, search for the api's below, and look at the tutorials & examples for each one.
DrawFrameControl
DrawIcon
Arc
PolyBezier
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|