Windows Vista Forums
Vista Forums Home Join Vista Forums Donate 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

Is there a rotation guide somewhere? With impact on height and width?

Closed Thread
 
Thread Tools Display Modes
Old 03-23-2006   #1 (permalink)
Philippe Lavoie
Guest


 

Is there a rotation guide somewhere? With impact on height and width?

Hi

I'm having a hell of a time understanding how to effectively use
rotations with Xaml. Is there a resource on the web for this?

Rotation, is easy, however the effect of it on bounding box is really not.

For instance, I get an image from the web which is 100x800 and I want to
show it with a -90 rotation then scaled down to 200 pixels. Actually, I
don't know the exact values of the original image, I just know that 200
pixels is the target.

Simply saying rotate by -90 is useless on the image because the width
and height are not also adjusted by the rotated content.

I had to do the following:


<Canvas Width="190" Height="27"
<Image Canvas.Left="185" Canvas.Top="10" Width="Auto" Height="180"
Source="{Binding Path=ImageUri}" HorizontalAlignment="Stretch"
VerticalAlignment="Center" Grid.RowSpan="1" Grid.ColumnSpan="2"
MinWidth="0" MinHeight="0" ClipToBounds="False" Margin="0,0,0,0"
IsEnabled="True">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="90"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Canvas>


Now my problem was that I wanted to improve on my current design. Which
for now simply show a sk product as (where xXXXXXx is the image of a ski
or something like that)

xXXXXXXXXXXXXXXxx
Name $10
Description

To improve on it. I wanted to rotate the whole content of it without a
description.

x $
X 1
X 0
X
X n
X a
X m
x e

Then when the user clicks or hovers, rotate the content to show

xXXXXXXXXXXXXXXxx
Name $10
Description of
product

field A: babd
field B: baddfas

My current approach just doesn't work. The new width, height of the
rotated content are not known by the system (or something) and the
rotated content just doesn't fit inside the new box (without manually
adjusting a Top part and putting everything in a fixed sized canvas).

Please help.

Phil

Old 04-04-2006   #2 (permalink)
Adam Smith [MS]
Guest


 

Re: Is there a rotation guide somewhere? With impact on height and width ?

Since you want layout to respond to your Transform - rather than just
applying a Transform which only affects rendering - consider using
LayoutTransform rather than RenderTransform. This will apply the transform
on the input to the layout process rather than the output. Depending on
what you're doing, you should be good to go.

-Adam Smith [MS]

"Philippe Lavoie" <philippe.lavoie@cactus.ca> wrote in message
news:eQxtRIqTGHA.1672@tk2msftngp13.phx.gbl...
> Hi
>
> I'm having a hell of a time understanding how to effectively use rotations
> with Xaml. Is there a resource on the web for this?
>
> Rotation, is easy, however the effect of it on bounding box is really not.
>
> For instance, I get an image from the web which is 100x800 and I want to
> show it with a -90 rotation then scaled down to 200 pixels. Actually, I
> don't know the exact values of the original image, I just know that 200
> pixels is the target.
>
> Simply saying rotate by -90 is useless on the image because the width and
> height are not also adjusted by the rotated content.
>
> I had to do the following:
>
>
> <Canvas Width="190" Height="27"
> <Image Canvas.Left="185" Canvas.Top="10" Width="Auto" Height="180"
> Source="{Binding Path=ImageUri}" HorizontalAlignment="Stretch"
> VerticalAlignment="Center" Grid.RowSpan="1" Grid.ColumnSpan="2"
> MinWidth="0" MinHeight="0" ClipToBounds="False" Margin="0,0,0,0"
> IsEnabled="True">
> <Image.RenderTransform>
> <TransformGroup>
> <RotateTransform Angle="90"/>
> </TransformGroup>
> </Image.RenderTransform>
> </Image>
> </Canvas>
>
>
> Now my problem was that I wanted to improve on my current design. Which
> for now simply show a sk product as (where xXXXXXx is the image of a ski
> or something like that)
>
> xXXXXXXXXXXXXXXxx
> Name $10
> Description
>
> To improve on it. I wanted to rotate the whole content of it without a
> description.
>
> x $
> X 1
> X 0
> X
> X n
> X a
> X m
> x e
>
> Then when the user clicks or hovers, rotate the content to show
>
> xXXXXXXXXXXXXXXxx
> Name $10
> Description of
> product
>
> field A: babd
> field B: baddfas
>
> My current approach just doesn't work. The new width, height of the
> rotated content are not known by the system (or something) and the rotated
> content just doesn't fit inside the new box (without manually adjusting a
> Top part and putting everything in a fixed sized canvas).
>
> Please help.
>
> Phil
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animating Width/Height to an auto value Ramon de Klein Avalon 0 05-27-2008 04:06 AM
How to resize (height/width) an avi in Windows Movie Maker Dusty Vista music pictures video 5 11-16-2007 07:15 AM
rss feed gadget's height Wayne. Vista General 0 05-09-2007 10:26 PM
How to implement percent height & width in a custom control? joan Avalon 1 05-08-2006 08:34 AM
Width and Height values in markup CosminB [BRT] Avalon 2 04-21-2006 08:31 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