AllocTarget Method

Summary
Pre-allocates the capture target to the specified size.
Syntax
C#
C++/CLI
public virtual void AllocTarget( 
   int size 
) 
public: 
virtual void AllocTarget(  
   int size 
)  

Parameters

size
Value containing the size of the target to be allocated, in megabytes.

Remarks

Pre-allocates the capture target to the specified size. This method is typically used when the target is defined as a file. For best capture results, always capture to a defragmented, pre-allocated capture file that is larger than the size of the capture data. If the method fails, an error is raised. For more information, refer to the Error Codes.

Example
C#
using Leadtools; 
using Leadtools.Multimedia; 
using LeadtoolsMultimediaExamples.Fixtures; 
 
 
public bool _result = false; 
public CaptureCtrlForm _form = new CaptureCtrlForm(); 
string outFile = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_AllocTargetExample.avi"); 
 
public void AllocTargetExample() 
{ 
   // reference the capture control 
   CaptureCtrl capturectrl = _form.CaptureCtrl; 
 
   try 
   { 
      // set the target output file 
      capturectrl.TargetFile = outFile; 
 
      // allocate a file 
      capturectrl.AllocTarget(1000); 
 
      _result = File.Exists(outFile); 
   } 
   catch (COMException) 
   { 
      _result = false; 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
 
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.