Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I want to draw graphics like Line, Rectangle, Circle etc. and want to zoom it on Panel.

I have done to create line, rectangle, circle etc. I have a problem to zoom it.
Posted
Comments
Sergey Alexandrovich Kryukov 17-Oct-13 0:59am    
When you mention "Panel", the question is: which one? Full type name, please.
You need to tag the UI/graphics library or application type your are using, as soon as UI or graphics is involved...
—SA
Dharmendra-18 17-Oct-13 4:50am    
I have draw graphics on panel and i want to zoom it.. so if any line or rectangle is small to show clearly..

1 solution

Are you painting on a WinForms control? If so, you can use ScaleTransform[^]

Example (from the above page):
C#
private void ScaleTransformFloat(PaintEventArgs e)
{

    // Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F);

    // Then to scale, prepending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F);

    // Draw scaled, rotated rectangle to screen.
    e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100, 40);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900