"Making frame-by-frame animations"/"playing GIF" in Silverlight

Source: Internet
Author: User

"Frame-by-frame animation" and "playing GIF" seem to be irrelevant to the two gender, but they are not actually!

Because the image control in Silverlight does not support the direct use of GIF animation as the source, it is like the commonly used "Walking villain" and "loading Animation "... this type of typical GIF material cannot be directly used. It can only be converted to frame-by-frame animation for processing.

NASA (Silverlight MVP) provides two classic approaches:

1. Similar to the principle of film placement in old movies, it is implemented using the storyboard mechanism.

Original article: http://www.cnblogs.com/nasa/archive/2008/03/24/1119771.html

Use tools such as Photoshop and fireworks to extract materials from GIF images and splice them into a picture. Then, use a rectangle as a mask. Then, move the image to the left at a specified time.

(Meaning background positioning in CSS ):

 

2. Regularly fill the specified rectangle with imagebrush

Original article: http://www.cnblogs.com/nasa/archive/2009/09/11/imageBrush-Animate.html

You can also prepare the frames and use timer to switch the imagebrush of the rectangle in sequence.

 

3. Similar to the method principle mentioned in 2, the source attribute of the image is changed regularly.

From http://www.cnblogs.com/024hi/archive/2009/09/14/1566653.html

Here, another MVP jillzhang open-source GIF Processing library is used in the garden. With this tool class, each GIF frame is taken out to form a writeablebitmap array, then, use timer to regularly retrieve the array element in sequence as the source rotation of the image.

Good online sample http://joestegman.members.winisp.net/SL3/GIFDecoderSample/Default.html

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.