?
Solved

Vector drawing component for Delphi?

Posted on 1997-04-02
3
Medium Priority
?
1,304 Views
Last Modified: 2008-03-03
As part of developing a quotation system for our product, we would like to generate a simple line drawing of the item the user is interested in. This would mostly be a simple shape (square, rectangle, semi-circle) of arbitrary dimensions, with different border widths, border colors, and fill pattern.

In addition, we would like to generate several shapes, and have the user move them around on the screen-- not edit or change the shape, just move several shapes in relation to each other.

Is anyone aware of a component or add-on that would allow on-the-fly generation of (relatively) simple shapes/line-drawings within a Delphi app?

Any ideas? Comments? Suggestion? Thanks in advance.
0
Comment
Question by:loewen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Expert Comment

by:morwoodk
ID: 1335095
Look under the 'Additional' tab of the component toolbar.  There is a component called TShape there.  These can be squares, ellipses and so on.  Once you drop the component on the canvase you can move it around.  You can also create instances of it on the fly.
0
 

Author Comment

by:loewen
ID: 1335096
I am aware of the design-time shape components. However, we need to generate a shape (typically a frame consisting of several overlapping rectangles) and allow the user to move it around in relation to other shapes he has already defined.

(i.e. ok, our product is windows. The user chooses a window size, and grille type, and we generate a simple line drawing (but to scale) of the window, including grille pattern. To create a combination window, you define several single windows, and drag them together to create the one combination unit)

Is there a way to create the shapes, and still allow the user to drag them around at run-time?

Dave Lehman
(davelehman@loewen.com)
0
 

Accepted Solution

by:
morwoodk earned 300 total points
ID: 1335097
Yes, while I haven't had time to actually do it...you should be able to create an instance of the TShape on the form and hook it to some generic pick and drag code.

It actually sounds like fun.  I'll try it myself and let you know.  

If you want to get started yourself you would do something like:

aSquare := TShape.create( aOwner)
{ set the various attributes progammatically }
{ set the parent to the form ... so that the object shows up }
{ set some event handlers to methods you've written to handle mouse clicks and so on.}

Kev.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question