Click here to Skip to main content
Licence 
First Posted 3 Jan 2004
Views 37,357
Downloads 288
Bookmarked 11 times

Rotation transformer example

By ashvin | 3 Jan 2004
Example of Rotation transformer in Longhorn.
5 votes, 50.0%
1
2 votes, 20.0%
2
1 vote, 10.0%
3
1 vote, 10.0%
4
1 vote, 10.0%
5
2.05/5 - 10 votes
μ 2.05, σa 2.54 [?]

Introduction

Longhorn is code name of next Microsoft Windows major release. This version of OS is more technology driven. In each version, Microsoft comes with new GUI idea. E.g., XP with new look and feel with clear type font technology. Longhorn will include GUI based on SVG instead of Bitmapped (GDI+). SVG is more faster to generate cool graphics effects without effecting CPU performance.

Microsoft released LongHorn PDC version in 2003. This is alpha version, so it includes much much less then targeted in final release. This OS final version is expected in 2006 but there are so many information available to begin and gain knowledge before the OS hits the software industry.

Keep watch on the following sites to get knowledge:

Microsoft is not working only on OS but also working on the next generation IDE code name Whidbey and new SDK.

Transform Decorator

In Avalon API, Microsoft included TransformDecorator. Avalon is code name for next generation GUI API and Aero is next generation OS GUI. TransformDecorator is a component container that allows to add special effects to child components with out affecting or changing component's basic functionality.

So, before adding any component directly in WinForm or canvas, first you can add component to TransformDecorator and then add that TransformDecorator to WinForm or canvas, and attach transformer to that TransformDecorator.

Rotate Transform

RotateTransform adds rotation effect to child component. It accepts angle as input and rotates component by that angle. See below:

Sample screenshot

Sample screenshot

Adding Component in Transform Decorator

// Create a canvas sized to fill the window
canvasLeft = new Canvas ();
canvasLeft.Background = MSAvalon.Windows.Media.Brushes.BlueViolet;
mainWindow.Children.Add(canvasLeft);
canvasLeft.Width = new Length(80f, UnitType.Percent);
canvasLeft.Height = new Length(100f, UnitType.Percent);
//List Box
lstBox = new ListBox();
transformer = new TransformDecorator();
transformer.Width = new Length(90f, UnitType.Percent);
transformer.Height = new Length(90f, UnitType.Percent);
Canvas.SetLeft(transformer, new Length(5f, UnitType.Percent));
Canvas.SetTop(transformer, new Length(5f, UnitType.Percent));
RotateTransform myRotateTransform = new RotateTransform(160);
transformer.Transform = myRotateTransform;
transformer.Child = lstBox;
canvasLeft.Children.Add(transformer);

Changing Angle

public void comboBox_SelectionChanged(object sender, 
          SelectionChangedEventArgs args)
{
  RotateTransform myRotateTransform = 
    new RotateTransform(System.Convert.ToDouble(args.SelectedItems[0]));
  transformer.Transform = myRotateTransform;
}

Note

This demo will only work on PDC version of Longhorn OS.

Finally...

This is only one example of cool effect in LongHorn, there are many other cool effects. See demo of same effect here.

Enjoy!!!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

ashvin

Web Developer

United States United States

Member
Senior Software Er.
Aspect Communication
San Jose USA CA
 


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120210.1 | Last Updated 4 Jan 2004
Article Copyright 2004 by ashvin
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid