Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scale an entire WPF window

Tags:

I have a WPF application that I am going to be demoing to an audience on a large, high-resolution projector, and I am worried that the application will be too small to see from afar.

Is there a simple way to make the ENTIRE application bigger (like the zoom slider in the WPF designer, that lets you zoom in?) I tried adding a layout transform to the Window in XAML, like so:

<Window.LayoutTransform>     <ScaleTransform ScaleX="1.5" ScaleY="1.5" CenterX=".5" CenterY=".5" /> </Window.LayoutTransform> 

which makes the window look bigger in the designer, but seems to have no effect on the running application.

I figure this should be dead simple with WPF's "resolution independence", high-tech text rendering, vector graphics, etc.

(I know I can use a screen zooming tool, but that's lame since it makes everything fuzzy, and always makes me dizzy when the presenter pans around the screen.)

like image 273
Hank Avatar asked Feb 16 '11 21:02

Hank


2 Answers

Just realized that putting the transform on the top-level control (a Grid, in my case), instead of on the window itself, has a similar effect to what I was looking for. The only difference is that the window size doesn't change so everything looks a little cramped, but that is easily remedied by making the window larger.

like image 131
Hank Avatar answered Sep 18 '22 02:09

Hank


I posted a fairly detailed example of scaling the main element in another question. Perhaps it would be of some use to you.

like image 39
JacobJ Avatar answered Sep 20 '22 02:09

JacobJ