When it comes to Image Manipulation, Flash and Silverlight has much more advantages over Javascript and DHTML. In this example, when you click on the image, it will produce an amazing sponge effect. What’s more? Just to use your imagination!
It included both Flash and Silverlight version with complete source codes.
Comparison
Flash implementation: 45 minutes
Silverlight implementation: 30 minutes
Code variation in the source code:
- rotation [AS3] vs RotateTransform [C#]
Source codes
Sponge Image [Flash 9, AS3] (42.6 KiB, 759 hits)
Sponge Image [Silverlight 2, C#] (128.1 KiB, 877 hits)
Flash
Silverlight
rotation [AS3] vs RotateTransform [C#]
When rotating an object in AS3, it’s really straight forward.
// AS3 displayObject.rotation = 180; // the value can be set between 0 and 360
What about in C#? It will take 3 lines. Anyway, it can’t be considered as verbose. But when you look in to the case in XAML, you may find a hard time in modifing the XML manually (Especially for me since I am not yet an Silverlight Expert).
// C# RotateTransform r = new RotateTransform(); r.Angle = 180; // the value can be set between 0 and 360 DisplayObject.RenderTransform = r; // Setting the angle in XAML //