Inheritance: VidkaClipVideoAbstract
コード例 #1
0
ファイル: VidkaImaging.cs プロジェクト: miktemk/VidkaEditor
 public static void RenderSimpleTextVideoClipToFile(VidkaClipTextSimple clip, VidkaProj proj, string outFilename)
 {
     Bitmap image = RenderSimpleTextVideoClip(clip, proj);
     // save all to one jpg file
     image.Save(outFilename, ImageFormat.Jpeg);
     image.Dispose();
 }
コード例 #2
0
ファイル: VidkaImaging.cs プロジェクト: miktemk/VidkaEditor
 public static Bitmap RenderSimpleTextVideoClip(VidkaClipTextSimple clip, VidkaProj proj)
 {
     Bitmap image = new Bitmap(proj.Width, proj.Height);
     Graphics ggg = Graphics.FromImage(image);
     ggg.FillRectangle(new SolidBrush(Color.FromArgb(clip.ArgbBackgroundColor)), 0, 0, proj.Width, proj.Height);
     var font = new Font(FontFamily.GenericSansSerif, clip.FontSize);
     var ssss = ggg.MeasureString(clip.Text, font);
     ggg.DrawString(clip.Text, font, new SolidBrush(Color.FromArgb(clip.ArgbFontColor)), (proj.Width - ssss.Width) / 2, (proj.Height - ssss.Height) / 2);
     ggg.Flush();
     return image;
 }
コード例 #3
0
 public void SetVideoClip(VidkaClipTextSimple clip)
 {
     VClip = clip;
     // set all the UI
     txt.Text = VClip.Text;
     ddlFontSize.SelectedItem = VClip.FontSize.ToString();
     Color clrBckground = Color.FromArgb(VClip.ArgbBackgroundColor);
     Color clrFont = Color.FromArgb(VClip.ArgbFontColor);
     pnlColor.BackColor = clrBckground;
     pnlColor.Invalidate();
     colorDialog1.Color = clrBckground;
     pnlFontColor.BackColor = clrFont;
     pnlFontColor.Invalidate();
     colorDialog2.Color = clrFont;
 }
コード例 #4
0
        public override void Run()
        {
            var imgFilename = VidkaIO.MakeUniqueFilename_AuxSimpleText();
            var imgFilenameFull = VidkaIO.GetAuxillaryProjFile(Context.CurFileName, imgFilename);
            var newClip = new VidkaClipTextSimple()
            {
                Text = "Hello :)",
                ArgbBackgroundColor = Color.Black.ToArgb(),
                ArgbFontColor = Color.White.ToArgb(),
                FontSize = 20,
                FileName = imgFilenameFull,
                FileLengthSec = Settings.Default.ImageClipLengthSeconds,
                FileLengthFrames = Context.Proj.SecToFrame(Settings.Default.ImageClipLengthSeconds),
                FrameStart = 0,
                FrameEnd = Context.Proj.SecToFrame(Settings.Default.TextClipInitialLengthSeconds),
            };
            VidkaIO.RebuildAuxillaryFile_SimpleText(newClip, Context.Proj, Context.MetaGenerator);

            Context.AddUndoableAction_insertClipAtMarkerPosition(newClip);
        }
コード例 #5
0
ファイル: VidkaIO.cs プロジェクト: miktemk/VidkaEditor
 public static void RebuildAuxillaryFile_SimpleText(VidkaClipTextSimple vclip, VidkaProj Proj, MetaGeneratorInOtherThread metaGenerator)
 {
     var filename = vclip.FileName;
     VidkaIO.MakeSureFolderExistsForFile(filename);
     VidkaImaging.RenderSimpleTextVideoClipToFile(vclip, Proj, filename);
     metaGenerator.RequestThumbsOnly(filename, true);
 }