Exemplo n.º 1
0
        private void gif_Click(object sender, EventArgs e)
        {
            List <Image> res  = GetImages();
            Size         size = GetSizeFromImages(res);

            using (SaveFileDialog dialog = new SaveFileDialog())
            {
                dialog.Filter = "GIF文件(*.gif)|*.gif";
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    if (File.Exists(dialog.FileName))
                    {
                        File.Delete(dialog.FileName);
                    }
                    Application.DoEvents();
                    ViedoMarkFactory fac = new ViedoMarkFactory();
                    if (fac.Mark(dialog.FileName, "gif", size, 265, res.ToArray(), null))
                    {
                        MessageBox.Show("动画文件:\n\n" + dialog.FileName + "\n已成功保存!");
                    }
                }
                //ViedoMarkFactory fac = new ViedoMarkFactory();
                //bool ok = fac.Mark("e://eee", "avi", size, 265, res.ToArray(), null);
            }
        }
Exemplo n.º 2
0
        private void GetBitmaps(object sender, EventArgs e)
        {
            Bitmap[] bitmaps = _avi.Bitmaps;
            if (bitmaps == null || bitmaps.Length == 0)
            {
                return;
            }
            Size size = bitmaps[0].Size;

            if (_fname == null)
            {
                _fname = SelectFilename();
            }
            string outputType = GetTypeFromFilename(_fname);

            if (string.IsNullOrEmpty(outputType))
            {
                return;
            }
            ViedoMarkFactory fac  = new ViedoMarkFactory();
            bool             isOk = fac.Mark(_fname, outputType, size, _interval, bitmaps, null);

            DisposeAvi();
        }