Flash and Silverlight: Fish Eye Menu Flash vs Silverlight: 3D Image Navigation
Sep 02

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

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
// 
//    
//        
//     
// 	

Related Post

7 Responses to “Flash vs Silverlight: Sponge Image”

  1. Le Says:

    So Silverlight produced a file three times the size of Flash? 128kb vs 43kb? That’s important to know when trying to choose a tool to develop on. What’s the pro and cons when it comes to DHTML vs Flash or Flex?

  2. JOKe Says:

    or JavaFX :D

  3. admin Says:

    Le, thanks for your question. Firstly, the size in of the image is 16.1KB. In the Zip of Flash, since it inclued the FLA and swf, hence 43KB is make sense.

    However, in the case of Silverlight, the debug folder will out 3 files SpongeImage.xap, SpongeImage.pdf and SpongeImage.dll. (Actually only SpongeImage.xap is needed for the application to be shown in the website). I think other files are used for debug purpose and hence the file size is larger.

    Anyway, as far as I know, most of the time, the filesize of the Silverlight applicatoin is larger than that of Flash

    Secondly, about the pros and cons. I think I can’t go to deep here (since I don’t have enough much information to compare them). But one can’t argue that the image rendering speed of Flash and Silverlight is much faster than DHTML.

  4. Rick Beerendonk Says:

    RotateTransform r = new RotateTransform();
    r.Angle = 180;
    DisplayObject.RenderTransform = r;

    Can be replaced with:

    DisplayObject.RenderTransform = new RotateTransform() { Angle = 180 };

  5. Laurent Bugnion Says:

    Hi,

    First thanks for this blog, which is really interesting and a great value for beginners with Silverlight technology. I actually referenced your site in my book Silverlight 2 Unleashed which will be published this month.

    Please note that of all the files you include in your Zip file, only the XAP file (as well as possibly resources such as images or videos) need to be deployed to the web server. All the other files are source code only and only needed to work on the application for example in Visual Studio or Blend.

    This is important to underline, because people have the impression that they need to deploy all these files to their server, and that they will be passed to the web client, but they don’t. The XAP file contains everything that is needed.

    For what it’s worth, and without wanting to self-promote in an obnoxious way, my book was specifically written to help beginners in .NET and/or Silverlight to start gradually and to understand what files are created, how the tools work, what to deploy, etc… I would be very interested in collaborating with you on some level. I bring a large experience as .NET developer, and I have a good experience in collaborating with designers, based on my works in Windows Presentation Foundation (a rich desktop technology very close to Silverlight)

    Let me know if you would be interested in such a collaboration.

    Thanks,
    Laurent

  6. Tom Says:

    Yes, Laurent is right. The real size comparison here should be between the outputs: the Flash SWF is 19KB, and the Silverlight XAP is 30KB. Note that with more efficient compression, the XAP could be down to 25KB or less. XAP is the same as ZIP file format, and the compressor used by Visual Studio is not very efficient for some reason.

    Also, a Silverlight source-only distribution could be made much smaller by only including the necessary files - that is, the source code. It’s not necessary to include the obj and bin directories - these are intermediate and output files generated by Visual Studio.

    Anyway, Terence, you might want to change the file sizes you display or the files you distribute to prevent misunderstandings like this. In the current approach, you present a strong context for comparison but then show two numbers that don’t really make sense to be compared.

  7. admin Says:

    Tom, really thanks for you suggestoin. Actually, the filesize is generated by the plugin and it’s interested it becomes one of the comparison elements.

    Acutally, in the latest samples, I have already erased all the gratuitious files before zipping the file. I hope this can give reader a fair comparsion in filesize.

Leave a Reply