It's not clear to me what you are trying to do. Do you want to draw Triangle on image? Do you want to draw scalable Triangle? Do you want to give the user the ability to Draw Triangle at runtime over image or form?
You can Draw Triangles over graphic objects (including images) by using the Graphics.FillPolygon method. You can find more information here:
But if you want to draw Triangles over images so that the user can scale, resize, move and delete them at runtime, you can use Annotations features as shown in the following thread:
Thanks for the reply. Sorry for the lack of information. It looks like I might have worded my question incorrectly. What I want to know how to do is to scale a triangle to size.
Say for example, I have a triangle, or really any geometric shape. Let's assume a circle. In reality, the circle might be 20 inches. How can I allow the user to change the image size to fit on the screen while maintaining proper scale? This is a calculator of sorts that will supply various information about angle and point. I would like to be able to scale everything at the same time.
Would I put that in a canvas, and allow the user to scale the entire canvas? If so, how can I go about that?
I don't have an issue with drawing the shapes. It's only in manipulating them.
I hope I understood your requirements correctly this time.
You want to draw a shape (like triangle) and then scale it based on a user input. Is this correct?
If yes, you need to handle the OnPaint event and access the Graphics property of the System.Windows.Forms.PaintEventArgs class.
After this, you can transform the painting area using the Graphics.Transform property (System.Drawing.Drawing2D.Matrix). And call the Graphics.Transform.Scale or Graphics.ScaleTransform methods to apply the specified scaling based on the user input.
But if you want to draw your shapes on a different layer over the image without modifying the image's pixel data, so that you can transform and scale the objects programmatically based on the user's input, you can use annotations features.
Please check the following online application to get an idea about what I am talking about:
Lourenco Frederico4 pointsPosted Jul 1, 2015, 11:50 PM EDT
Do you want to draw Triangle on image?
Do you want to draw scalable Triangle?
Do you want to give the user the ability to Draw Triangle at runtime over image or form?
Todd Sm15 pointsPosted Jul 6, 2015, 3:19 AM EDT
Lourenco Frederico4 pointsPosted Aug 20, 2015, 3:04 AM EDT