Home > Net >  About animated GIF files for each frame
About animated GIF files for each frame

Time:03-12

Read an animation file, and then close the file, (it will not interfere with other image editing software to modify the file saved, more friendly,) and then assigned to a bitmap object, array will animation into a bitmap, a frame in the array when the bitmap images on the original bitmap variable assignment again, and changed the color of the bitmap information, would affect the bitmap array corresponds to the frame, how did that happen? Is not should be independent, how can not affect? Part of the code is as follows, to assign the code is not here, in other cases,
 
Byte [] imgbyte=File. ReadAllBytes (FileName);
BMP=(Bitmap) Image. FromStream (new MemoryStream (imgbyte));//global BMP bitmap object variable
FrameDimension fd=new FrameDimension (BMP) FrameDimensionsList [0]).
Int count=BMP. GetFrameCount (fd);
Frames=new Bitmap (count);
for (int i=0; I & lt; The count. I++)
{
BMP. SelectActiveFrame (fd, I);
Frames [I]=new Bitmap (BMP) Width, BMP. Height);
Graphics g=Graphics. FromImage (Frames [I]);
G.D rawImage (BMP, new Rectangle (0, 0, BMP. Width, BMP, Height));
}

CodePudding user response:

In dialog, select frame 0 images, for example, is loaded into the main screen, in the main interface to rid the bird belly light yellow parts, when the open dialog box again, frame 0 bird belly corresponding parts have also been removed, but I'm not an array Frames to assignment,


  •  Tags:  
  • C#
  • Related