// Source image path string imgPath = Environment. getFolderPath (Environment. specialFolder. desktop) + @ "\ 0.gif"; // source Image img = Image. fromFile (imgPath); // if (img. width> 100 & img. height> 100) {// the first frame of the new Image, Image new_img = new Bitmap (100,100); // other frames of the new Image, Image new_imgs = new Bitmap (100,100 ); // The first frame of the new graph, GDI + Drawing Object, Graphics g_new_img = Graphics. fromImage (new_img); // New Graph other frames GDI + Drawing Object Graphics g_new_imgs = Graphics. fromImage (new_imgs); // configure the first frame of the new graph, GDI + Drawing Object g_new_img.CompositingMode = CompositingMode. sourceCopy; g_new_img.InterpolationMode = InterpolationMode. highQualityBicubic; g_new_img.PixelOffsetMode = PixelOffsetMode. highQuality; g_new_img.SmoothingMode = SmoothingMode. highQuality; g_new_img.Clear (Color. fromKnownColor (KnownColor. transparent); // configure other frames. GDI + Drawing Object g_new_imgs.CompositingMode = CompositingMode. sourceCopy; g_new_imgs.InterpolationMode = InterpolationMode. highQualityBicubic; g_new_imgs.PixelOffsetMode = PixelOffsetMode. highQuality; g_new_imgs.SmoothingMode = SmoothingMode. highQuality; g_new_imgs.Clear (Color. fromKnownColor (KnownColor. transparent); // traverse the dimension foreach (Guid gid in img. frameDimensionsList) {// because the GIF file is reduced, set it to Time. // if it is TIFF, set it to PAGE FrameDimension f = FrameDimension. time; // get the total number of frames int count = img. getFrameCount (f); // Save the parameter Encoder encoder = Encoder. saveFlag; // EncoderParameters ep = null; // image encoding and decoder ImageCodecInfo ici = null; // image encoding and decoder set ImageCodecInfo [] icis = ImageCodecInfo. getImageDecoders (); // assign foreach (ImageCodecInfo ic in icis) {if (ic. formatID = ImageFormat. gif. guid) {ici = ic; break ;}// for each frame (int c = 0; c <count; c ++) {// select the frame img specified by the dimension and index. selectActiveFrame (f, c); // the first frame if (c = 0) {// draw the first frame of the source image to the first frame of the new image g_new_img.DrawImage (img, new Rectangle (0, 0,100,100), new Rectangle (0, 0, img. width, img. height), GraphicsUnit. pixel); // copy the vibrator and transparent background palette to the first frame of the new image (int I = 0; I
// Effect
100*100