EnableStillCapture Property

Summary
Gets the value indicating whether still images can be captured during conversion.
Syntax
C#
C++/CLI
public virtual bool EnableStillCapture { get; set; } 
public: 
virtual property bool EnableStillCapture { 
   bool get(); 
   void set (    bool ); 
} 

Property Value

true if still images can be captured during conversion; false, otherwise.

Remarks

The default value for this property is false. To capture still images during conversion, the user must set the value of this property to true before calling the SaveStillBitmap method. Use the StillCaptureLimit property to get or set the time limit, in milliseconds, for capturing a still image. Use the SaveStillBitmap method to save a bitmap snapshot from the running stream to a file.

Example
C#
using Leadtools; 
using Leadtools.Multimedia; 
using LeadtoolsMultimediaExamples.Fixtures; 
 
 
public bool _result = false; 
public ConvertCtrlForm _form = new ConvertCtrlForm(); 
public ConvertCtrl _convertctrl = null; 
public string _bmpFile = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_SaveStillBitmap.bmp"); 
 
public void SaveStillBitmapExample() 
{ 
   // input and output file names 
   string inFile = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_Source.avi"); 
   string outFile = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_SaveStillBitmapExample.mpg"); 
 
   try 
   { 
      // reference the convert control 
      _convertctrl = _form.ConvertCtrl; 
 
      // set a timer on the form to make the still bitmap 
      _form.TestTimer.Interval = 5000; 
      _form.TestTimer.Tick += new EventHandler(SaveStillBitmap_Helper); 
 
      // enable still capture 
      _convertctrl.EnableStillCapture = true; 
 
      // set the time window limit for capture of stills (ms) 
      _convertctrl.StillCaptureLimit = 100000; 
 
      // set the compressor to DVVideo 
      _convertctrl.VideoCompressors.DVVideo.Selected = true; 
 
      // set the source and target files 
      _convertctrl.SourceFile = inFile; 
      _convertctrl.TargetFile = outFile; 
 
      // convert it now! 
      _convertctrl.StartConvert(); 
 
      // now start the test timer for the still capture 
      _form.TestTimer.Start(); 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
 
   // we'll loop on the state and pump messages for this example. 
   // but you should not need to if running from a Windows Forms application. 
   while (_convertctrl.State == ConvertState.Running) 
      Application.DoEvents(); 
} 
 
public void SaveStillBitmap_Helper(object sender, EventArgs e) 
{ 
   // cancel the timer 
   _form.TestTimer.Stop(); 
 
   // try to simulate an error condition 
   _convertctrl.SaveStillBitmap(_bmpFile, StillFormatType.BMP, 0, 0, -1); 
 
   // check for the capture file and set the result 
   if (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), _bmpFile))) 
      _result = true; 
} 
 
static class LEAD_VARS 
{ 
   public const string MediaDir = @"C:\LEADTOOLS23\Media"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Multimedia Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.