Solved

Vector drawing component for Delphi?

Posted on 1997-04-02
3
1,256 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
  • 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 100 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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