Then send the GIF animation processing class library-version 315

Source: Internet
Author: User
No nonsense, added multiple GIF image Merging , Improves the monochrome Algorithm
Merging effect:
Source image:

Too many images, as shown above

Effect after merging:

The following three animations

Effect after merging

Note: The best size of the merged images is the same. I didn't find the exactly the same image, so I paid a lot of attention. When I wrote JavaScript, I knew that the guy ie was very adaptable, I can write a function at will to support it, but this time ie dragged me down, and my original image size was inconsistent. At first I did not find the maximum height and maximum length, And I merged them one by one, there is no problem in browsing in windows, so you can not animation in IE, but in Firefox, it takes a long time to find the reason for the size. Then I added Size findmaxsize (list < String > Sources)
{
List < Int > Widths =   New List < Int > ();
List < Int > Heights =   New List < Int > ();
Foreach ( String S In Sources)
{< br> bitmap BMP = New Bitmap (s);
widths. add (BMP. width);
heights. add (BMP. height);
BMP. dispose ();
}
Widths. Sort ();
Heights. Sort ();
Return   New Size (widths [widths. Count -   1 ], Heights [heights. Count -   1 ]);
}

To solve the problem

The merge method is as follows:

/**/ /// <Summary>
/// Merge multiple GIF files
/// </Summary>
/// <Param name = "sourcegifs">Original Image path set</Param>
/// <Param name = "outgif">Merged image path</Param>
/// <Param name = "delay">Interval</Param>
/// <Param name = "repeat">Repeated playback?</Param> 
Public VoidMerge (list<String>Sourcegifs,StringOutgif,ShortDelay,BoolRepeat)

In addition, the monochrome algorithm has changed. The first monochrome effect is:
Source image:

After monochrome:

Some people found thatCodeAfter copying it, I immediately changed the copyright to my own name and posted it online. Later versions will not directly provide file downloads. If you need a friend, as long as you are a registered user of garden, send an email to me. I am sure to reply. This may be able to add some registered users for the garden, my email: jillzhang@126.com, again declared that the Garden brother has the need, mail to me can be, the inconvenience caused, please understand it.It is best to specify the blog site ID and URL in the email.

Statement: the code is public, but when used, please keep the author's information and copyright statement so that I can continue to improve it. Thank you for your cooperation.

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.