tags:

views:

75

answers:

2

I would like to learn about creating a program that I could draw simple shapes and be able to select them for editing - like resizing, order of display, color change. Is there an online resource that someone knows of that would help me reach my goals.

thanks

+2  A: 

"GDI+" is what you are looking for. You can start here: http://msdn.microsoft.com/en-us/library/da0f23z7.aspx

Sesh
+1  A: 

A sneaky way I used to do it was to create a custom control, remove the background from it and paint my shapes and sizes on it. Then, you can easily implement selection (override OnClick), dragging and resizing (OnMouseDown, OnMouseMove, OnMouseUp). You can then implement options like color, etc. by means of a property (see Browsable attribute and property get/setters) and a PropertyGrid control.

Anything beyond that, though - Bezier curves and such - would need something a tad more advanced, though.

The alternative is to only use such controls for the sizing handles, and do all the drawing on one central canvas - the only drawback then is figuring out how to select a shape on the canvas.

Fritz H
Have you any examples I could work from?
Brad
Unfortunately none that I have handy (at work at the moment), but the basic steps are:1. Create a custom control2. Override OnPaint to make it draw what you require3. Override OnClick method to "select" it4. Override OnMouseDown/Move/Up to implement dragging
Fritz H