Solved

Vector drawing component for Delphi?

Posted on 1997-04-02
3
1,223 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now