WriteHeader() private method

写文件头
private WriteHeader ( string header ) : void
header string 文件头
return void
示例#1
0
 internal static void Encode(GifImage gifImage, string gifPath)
 {
     FileStream fs = null;
     try
     {
         fs = new FileStream(gifPath, FileMode.Create);
         StreamHelper streamHelper = new StreamHelper(fs);
         streamHelper.WriteHeader(gifImage.Header);
         streamHelper.WriteLSD(gifImage.LogicalScreenDescriptor);
         if (gifImage.LogicalScreenDescriptor.GlobalColorTableFlag)
         {
             streamHelper.SetGlobalColorTable(gifImage.GlobalColorTable);
         }
         streamHelper.SetApplicationExtensions(gifImage.ApplictionExtensions);
         streamHelper.SetCommentExtensions(gifImage.CommentExtensions);
         SetFrames(gifImage.Frames, streamHelper, fs);
     }
     catch
     {
         throw;
     }
     finally
     {
         if (fs != null)
         {
             fs.Close();
         }
     }
 }
示例#2
0
        internal static void Encode(GifImage gifImage, string gifPath)
        {
            FileStream fs = null;

            try
            {
                fs = new FileStream(gifPath, FileMode.Create);
                StreamHelper streamHelper = new StreamHelper(fs);
                streamHelper.WriteHeader(gifImage.Header);
                streamHelper.WriteLSD(gifImage.LogicalScreenDescriptor);
                if (gifImage.LogicalScreenDescriptor.GlobalColorTableFlag)
                {
                    streamHelper.SetGlobalColorTable(gifImage.GlobalColorTable);
                }
                streamHelper.SetApplicationExtensions(gifImage.ApplictionExtensions);
                streamHelper.SetCommentExtensions(gifImage.CommentExtensions);
                SetFrames(gifImage.Frames, streamHelper, fs);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (fs != null)
                {
                    fs.Close();
                }
            }
        }