Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

annotation w/ gdi+

Status
Not open for further replies.

yeller2

Programmer
Feb 8, 2007
69
US
I'm considering writing my own annotation software - but I'd like some feedback on the potential success of such an undertaking. I'm asking because my experience with GDI+ is limited.

What I'll need to be able to do is to place graphics on a control, select them (which displays resize boxes at perimeter of graphic), resize them, move them and remove them.

Possible?
 
Quite easy to do - just involves a lot of math.

You can either use a simple panel and draw all your stuff on it or you can add controls to a panel for things like text and smaller graphics.

 
I'm thinking after doing some research that my best option would be to go with the controls approach. One of the main reasons being that I'm unable to find documentation for removing graphics that I've added to a control. Plus I will need to have control-like behavior.

Any other ideas anyone?
 
Removing a drawn image from a control is easy if you did it using GDI+.

Just call yourcontrol.Invalidate();

that will force the control to redraw. It's then up to your logic what to draw.

As for the controls, that is also easy. Just add the controls to a panel dynamically at runtime and set their postion as needed.

To get the original image on the panel you will want to set the Image or BackgroundImage property.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top