Board index » cppbuilder » Help with LineTo

Help with LineTo

Hi,

I have a program where the user needs to be able to highlight lines
previously draw. The original Line is draw using the LineTo method on a
Graphics::Bitmap. I need to be able to find the line pointed to, and draw a
box at the start and end position of this line.

How do I reference this Line?

Any help or suggestions would be greatly appreciated.

 

Re:Help with LineTo


There's no way to "select" a line already drawn on a bitmap. What you will
have to do is keep a list of previous drawing actions and use that list to
decide what the user has selected. It's not going to be easy to translate a
point on the screen to a particular line in your list. Maybe someone else
has a better suggestion.

--
Kent (TeamB and TurboPower Software)
C++Builder Developer's Journal (http://www.reisdorph.com)

Re:Help with LineTo


You have have a list of objects previously drawn.
Selecting an object is as simple as going through the list
and find the match.
Forget the idea of searching the timage. It might get stuck on
a character or even an artefact.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Quote
Steve Beckett wrote:

> Hi,

> I have a program where the user needs to be able to highlight lines
> previously draw. The original Line is draw using the LineTo method on a
> Graphics::Bitmap. I need to be able to find the line pointed to, and draw a
> box at the start and end position of this line.

> How do I reference this Line?

> Any help or suggestions would be greatly appreciated.

Re:Help with LineTo


Quote
Steve Beckett <SteveBeck...@amtech.fsnet.co.uk> wrote in message

news:7uhc71$dh012@forums.borland.com...

Quote
> I have a program where the user needs to be able to highlight lines
> previously draw. The original Line is draw using the LineTo method on a
> Graphics::Bitmap. I need to be able to find the line pointed to, and draw a
> box at the start and end position of this line.

> How do I reference this Line?

Take a look at the LineStretch Lab Report:
http://www.efg2.com/Lab/Graphics/LineStretch.htm

The example is in Delphi, but you can use the same
general approach.

___
efg

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

Other Threads