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.