[DispIdAttribute(8)]void RemoveMenuTitle(int Index)
Index
A zero-based index of the title
Removes the title at the specified index from the Titles list.
using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public ConvertCtrlForm _form = new ConvertCtrlForm();private ConvertCtrl _convertCtrl = null;private LTDvdWriter _dvdWriter = null;public void DvdWriterExample(){// reference the convert control_convertCtrl = _form.ConvertCtrl;// source files for DVD contentstring inFile1 = Path.Combine(LEAD_VARS.MediaDir, "DaDa_CMP.avi");string inFile2 = Path.Combine(LEAD_VARS.MediaDir, "DaDa_CMW.avi");string inFile3 = Path.Combine(LEAD_VARS.MediaDir, "DaDa_J2K.avi");string inFile4 = Path.Combine(LEAD_VARS.MediaDir, "Test_VideoStabilizer.avi");string backgroundImageFile = Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg");string outFile = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_DvdWriterExample_DVD");try{_dvdWriter = null;_convertCtrl.Preview = true;_convertCtrl.PreviewVisible = true;// setup the converter_convertCtrl.TargetFormat = TargetFormatType.DVD;_convertCtrl.VideoCompressors.Mpeg2.Selected = true;_convertCtrl.AudioCompressors.MpegAudio.Selected = true;// Create a DVD image with 2 titles, each contains 2 chapters:// Source video_convertCtrl.SourceFile = inFile1;// Destination image folder_convertCtrl.TargetFile = outFile;// Retrieve the DVD Writer interface_dvdWriter = _convertCtrl.GetSubObject(ConvertObject.Sink) as LTDvdWriter;_dvdWriter.RemoveAllMenuTitles();_dvdWriter.MenulessTitlePlay = false;// Set the TitleBreak property to false.// This will prevent the title from being written immediately after the conversion_dvdWriter.TitleBreak = false;_dvdWriter.AddMenuTitle("Title 1", -1);// Write the first chapter in the first title_convertCtrl.StartConvert();while (_convertCtrl.State != ConvertState.Stopped)Application.DoEvents();_convertCtrl.ResetSource();int highPart = 0;int lowPart = _dvdWriter.GetBytesWritten(out highPart);Int64 written = highPart << 32 | lowPart;_convertCtrl.SourceFile = inFile2;_convertCtrl.StartConvert();while (_convertCtrl.State != ConvertState.Stopped)Application.DoEvents();_convertCtrl.ResetSource();// Prepare for the second title// Set the TitleBreak property to TRUE, so the current title can be flushed_dvdWriter.TitleBreak = true;// Disable Overwrite so the title will be appended to an existing dvd image_dvdWriter.Overwrite = false;_dvdWriter.MenulessTitlePlay = false;// Set the TitleBreak property to FALSE.// This will prevent the title from being written immediately after the conversion_dvdWriter.TitleBreak = false;_dvdWriter.AddMenuTitle("Title 2", -1);// Write the first chapter in the second title_convertCtrl.SourceFile = inFile3;_convertCtrl.StartConvert();while (_convertCtrl.State != ConvertState.Stopped)Application.DoEvents();_convertCtrl.ResetSource();// Write the second chapter in the second title_convertCtrl.SourceFile = inFile4;_convertCtrl.StartConvert();while (_convertCtrl.State != ConvertState.Stopped)Application.DoEvents();_convertCtrl.ResetSource();// Close the second title_dvdWriter.TitleBreak = true;_dvdWriter.TitleMenu = true;_dvdWriter.MenuLoop = true;_dvdWriter.MenulessTitlePlay = false;// Write the second chapter in the second title_convertCtrl.SourceFile = backgroundImageFile;ChangeStillImageDuration(1.0);_convertCtrl.StartConvert();while (_convertCtrl.State != ConvertState.Stopped)Application.DoEvents();_convertCtrl.ResetSource();_dvdWriter.TitleMenu = false;_dvdWriter.Overwrite = false;_convertCtrl.ResetTarget();_convertCtrl.ResetSource();// done, free COM objectMarshal.ReleaseComObject(_dvdWriter);_dvdWriter = null;// set the result_result = true;}catch (Exception ex){_result = false;}}private void ChangeStillImageDuration(double duration){ILTStlImgRd pStlImgRd;try{pStlImgRd = _convertCtrl.GetSubObject(ConvertObject.SourceFilter) as ILTStlImgRd;if (pStlImgRd != null){// get the current menu durationdouble currentDuration;currentDuration = _convertCtrl.Duration;if (currentDuration * 2 <= duration)pStlImgRd.Loop = (int)(duration / currentDuration + 0.5);}}catch{}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";public const string MediaDir = @"C:\LEADTOOLS23\Media";}