Solved

Vector drawing component for Delphi?

Posted on 1997-04-02
3
1,264 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 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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