Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Complete scaling of a WPF window

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-10-2006   #1 (permalink)
Jason Dolinger
Guest


 

Complete scaling of a WPF window

Has anyone managed to completely scale a window up and down? I've found
that the LayoutTransform works quite well when using Controls but I'm
having problems with applying this to an actual window.

All Windows and controls has a property called LayoutTransform,
inherited from FrameworkElement:

public Transform LayoutTransform { get; set; }


Transform is an abstract call with a number of derived classes including
ScaleTransform and MatrixTransform. At runtime, it appears that the
window's LayoutTransform is of type MatrixTransform. What properties
can I use to scale the window up and down (with equivalent scaling in
both x and y dimensions?). I'm trying to study up on affine
transformation and the 3x3 matrix that you work with to accomplish it,
but, but I'm not yet accomplished enough in this area.

As a shortcut, I tried using ScaleTransform by replacing the window's
Layout transform like so (this is connected to a slider control):

w.LayoutTransform = new ScaleTransform(mySlider.value, mySlider.value);

What this accomplishes is to scale the contents of the window up and
down brilliantly, but the actual window itself remains the same (with
the leftover area being taken over by black space). What I need is for
the actual window boundary to go with the content.

Thanks, any information would be appreciated, as always!

Jason

My System SpecsSystem Spec
Old 01-10-2006   #2 (permalink)
D. F. Sklar
Guest


 

Re: Complete scaling of a WPF window

You might want to try playing with different values for the SizeToContent
property of the System.Windows.Window class. Setting that property to the
enum value "SizeToContent.WidthAndHeight" might just do the trick. (Its
default value is "Manual" which means
the window does not auto-adjust to the size of its content.)

Warning: I have NOT tried this. I took a quick look at the SDK doc and
thought this property might be relevant. I.e. this is pure conjecture. Let
us know your results, please...


My System SpecsSystem Spec
Old 01-10-2006   #3 (permalink)
Etienne Boucher
Guest


 

Re: Complete scaling of a WPF window

Windows themselves are not handled by WPF, they are still drawn by Win32, so
I don't think you can scale them as far as I know. The members you are
talking about will probably influence the content of the Window, not the
Window itself.

Etienne Boucher


My System SpecsSystem Spec
Old 01-10-2006   #4 (permalink)
David Sklar
Guest


 

Re: Complete scaling of a WPF window

You might want to try playing with different values for the
SizeToContent property of the System.Windows.Window class. Setting
that property to the enum value "SizeToContent.WidthAndHeight" might
just do the trick.

Warning: I have NOT tried this. I took a quick look at the SDK doc
and thought this property might be relevant. I.e. this is pure
conjecture. Do please let us know if it works out...

-- David Sklar

My System SpecsSystem Spec
Old 01-10-2006   #5 (permalink)
David Sklar
Guest


 

Re: Complete scaling of a WPF window

You might want to try playing with different values for the
SizeToContent property of the System.Windows.Window class. Setting
that property to the enum value "SizeToContent.WidthAndHeight" might
just do the trick.

Warning: I have NOT tried this. I took a quick look at the SDK doc
and thought this property might be relevant. I.e. this is pure
conjecture. Do please let us know if it works out...

-- David Sklar

My System SpecsSystem Spec
Old 01-10-2006   #6 (permalink)
D. F. Sklar
Guest


 

sorry about the multiple redundant postings...

sorry about the multiple redundant postings... I was using Google Groups to
post messages,

and now I know why it's still in beta. It's a great reader... but don't use
it post... yet...




My System SpecsSystem Spec
Old 01-10-2006   #7 (permalink)
Jason Dolinger
Guest


 

Re: sorry about the multiple redundant postings...

D. F. Sklar wrote:
> sorry about the multiple redundant postings... I was using Google Groups to
> post messages,
>
> and now I know why it's still in beta. It's a great reader... but don't use
> it post... yet...
>
>
>
>

Ouch, and I got all excited that there were some more replies! The
SizeToContent still doesn't do it unfortunately, I'll need to keep
looking. Thanks though!

Jason
My System SpecsSystem Spec
Old 01-11-2006   #8 (permalink)
Nick Kramer [MSFT]
Guest


 

Re: Complete scaling of a WPF window

Exactly, this is one of those accidents of class hierarchy -- as much as
possible we want Window to look like any other Control, but there's a few
aspects of Control we can't support. And a class hierarchy that split this
functionality out would be way more complexity that seems justified...

HwndHost has the same issue, by the way.

--
-Nick Kramer [MSFT]
http://blogs.msdn.com/nickkramer

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Etienne Boucher" <etienne@novat.qc.ca> wrote in message
news:Os$AJaJFGHA.1032@TK2MSFTNGP11.phx.gbl...
> Windows themselves are not handled by WPF, they are still drawn by Win32,
> so I don't think you can scale them as far as I know. The members you are
> talking about will probably influence the content of the Window, not the
> Window itself.
>
> Etienne Boucher
>



My System SpecsSystem Spec
Old 01-11-2006   #9 (permalink)
Jason Dolinger
Guest


 

Re: Complete scaling of a WPF window

Nick Kramer [MSFT] wrote:
> Exactly, this is one of those accidents of class hierarchy -- as much as
> possible we want Window to look like any other Control, but there's a few
> aspects of Control we can't support. And a class hierarchy that split this
> functionality out would be way more complexity that seems justified...
>
> HwndHost has the same issue, by the way.
>


So how is this done in Sparkle? When you use the workspace zoom slider
in Sparkle, all of the child windows scale up or down. Isn't Sparkle a
100% WPF application?

Thanks!
Jason
My System SpecsSystem Spec
Old 01-11-2006   #10 (permalink)
Drew Marsh
Guest


 

Re: Complete scaling of a WPF window

Jason Dolinger wrote:

> So how is this done in Sparkle? When you use the workspace zoom
> slider in Sparkle, all of the child windows scale up or down. Isn't
> Sparkle a 100% WPF application?


Just going from memory since I don't have time to load it up right now, there
are no "real" windows inside of Sparkle. It's not a true MDI interface, it's
all custom UI elements. So when they scale they're scaling 100% pure WPF
content.

HTH,
Drew
___________________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com/


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
window scaling Candace Vista General 1 06-03-2008 09:41 AM
Download Complete - Window does not close otterit Vista General 5 05-09-2008 07:47 PM
Scaling Remote Desktop to the client window size? Blue Max Vista networking & sharing 9 01-22-2008 12:30 PM
Scaling CesarTabares Avalon 2 06-05-2006 03:46 AM
how can i scale a complete window? Thorsten Thiel Avalon 2 04-24-2006 10:00 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51