-
July 6th, 2006, 04:18 PM
#1
Simple Vector Drawing Application
Hi friends,
Searched the internet for almost a week, but could not find a single simple example of vector drawing capabilities in Visual Basic 6.0.
The program flow is simple.
1. Draw vector shapes (Lines, rectangles, Bezier curves) in run time.
2. Selecting the shapes.
3. Modify the shape in real time.
Can you help me in developing this simple but brain teasing application??
Thanks in advance.
Keep smiling
-
July 6th, 2006, 05:24 PM
#2
Re: Simple Vector Drawing Application
Welcome to CodeGuru!
I think the stuff you want to do is best done via win32 API. I'd first recommend looking at AllApi.net, and get the free Guide and the Viewer. It can take awhile to become comfortable with the API and how to use them, but once you get going, it quickly gets easier.
Also, check out PlanetSourceCode.com for example projects. I'm sure there's plenty you will find useful there as well.
Take your time with this one. It's not a simple one-week application. You may also find a project in progress by Rich2189 to be very helpful. Many of the basic concepts you'll be using are discussed in those threads at length.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
July 6th, 2006, 06:38 PM
#3
Re: Simple Vector Drawing Application
Thanks Wizbang,
I have been using APIguide since last year. OK, there are lots of functions to display graphics. But designing a vector graphics application requires much more depths of intelligence. I had thought of designing a drawing surface consisting of multiple layers with vector element assigned to each of a different layer, but things were getting more complicated. Right now I am working like this:
1) Writing first to memoryDC
2) Storing location points into vector array.
3) Displaying it to the PictureBox.
The problem is with dragging/ translating the vector surfaces. I will code more intensively to find the solutions.
Let me know if you find some useful links for VB6.
Where can get Rich2189 threads?
-
July 6th, 2006, 08:04 PM
#4
Re: Simple Vector Drawing Application
I am in the middle of developing a system like what you want to do. I know what you mean about taking you a week and still no info.
This is what you need to do:
1. When you draw you need to save your objects in a CollectionBase so you save the object you drew on the PictureBox (I assume).
2. Widen the GraphicPath (so you can detect when the mouse is over a line. If it other than line you dont have to winden)
3. When you click on the object (mouse down event handler) loop the collectionbase and test for mouse-object intersection using Isvisible.
4. Bingo...now you knew which object was selected and you can do whatever you want, resize it, delete it, change its attributes...etc
I dont have any code to give you right now. As I said, I just started my program. Hopefully, soon I will post the code.
I hope that helped. Also, visit this site http://www.bobpowell.net it is a great GDI+ site.
Finally, Please share with us your code when you have it working
-
July 7th, 2006, 01:19 AM
#5
Re: Simple Vector Drawing Application
-
July 7th, 2006, 01:24 AM
#6
Re: Simple Vector Drawing Application
Great Links!
-
July 7th, 2006, 02:28 AM
#7
Re: Simple Vector Drawing Application
Hi SamerAZ,
I am using GDI+ with Visual Basic 6.0. I had visited Bob Powell article. It requires VB.Net. I want to do this application in VB 6.0. No doubt, we have to store the graphics object in a collection array. I will post the progress as soon I finish each functional step. Thanks.
Hi HanneSThEGreaT,
I studied the links you you posted. Well drawing is not the problem. Storing the drawings in transparent layers, and selecting the layer for manipulating the vector drawing is what required. Vector Graphics ActiveX control is a very good control, but we have to write the code from scratch. Thanks and stay in touch.
-
July 7th, 2006, 04:36 AM
#8
Re: Simple Vector Drawing Application
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
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
|