Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Register
Login
SkewTransform in Silverlight
WhatsApp
Praveen Moosad
15y
8.1
k
0
5
Resource
0
The example shown below skew an image to 45 degrees from a center point of (25, 25).
<
UserControl
xmlns
=
http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns
:
x
=
http://schemas.microsoft.com/winfx/2006/xaml
x
:
Class
="imginSL.MainPage"
Width
="640"
Height
="480">
<
Grid
x
:
Name
="LayoutRoot"
Background
="White">
<
Image
x
:
Name
="img"
Margin
="151,127,208,142"
Source
="Waterfall.jpg"
Stretch
="Fill">
<
Image.RenderTransform
>
<
SkewTransform
CenterX
="25"
CenterY
="25"
AngleX
="45"
AngleY
="0"></
SkewTransform
>
</
Image.RenderTransform
>
</
Image
>
</
Grid
>
</
UserControl
>
We can do the same from code behind.
SkewTransform
skew =
new
SkewTransform
();
skew.AngleX = 45;
skew.AngleY = 0;
skew.CenterX = 25;
skew.CenterY = 25;
img.RenderTransform = skew;
Output:
silverlight