Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
we wrote a program in WPF apllication with C# code,
we wrote the size of the window as maxisize,
The picture is not Increases in accordance with proportional window
what we have to do???

please help us!@
Posted

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 18-Dec-11 13:03pm    
Sure, same thing, a 5.
--SA
Abhinav S 18-Dec-11 13:05pm    
Thank you SA.
This is already done for you in WPF. All you need is using the class ViewBox, see http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox%28v=VS.100%29.aspx[^].

You need to put your content in an instance of the ViewBox, that's basically it.

When it scales its single content object, its scales everything in it, any content behaves like scalable vector graphics. You only need to pay attention for the property StretchDirection and take care about preserving the same aspect ratio.

See also this article: http://www.keyvan.ms/viewbox-and-viewport-in-windows-presentation-foundation[^].

—SA
 
Share this answer
 
Comments
Abhinav S 18-Dec-11 12:54pm    
Similar to my answer. 5. :)
Sergey Alexandrovich Kryukov 18-Dec-11 13:03pm    
Thank you, Abhinav.
--SA

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