Width Property

Summary
Gets the video width, in pixels.
Syntax
C#
C++/CLI
public int Width {get;} 
public: 
property int Width { 
   int get(); 
} 

Property Value

The width of the video, in pixels.

Example
C#
using Leadtools; 
using Leadtools.MediaFoundation; 
using LeadtoolsMediaFoundationExamples.Fixtures; 
 
 
public bool _result = false; 
public CaptureCtrlForm _form = new CaptureCtrlForm(); 
 
public void CaptureSizesExample() 
{ 
   // reference the capture control 
   CaptureCtrl capturectrl = _form.CaptureCtrl; 
 
   try 
   { 
      // select a USB video device, use your device name here 
      if (capturectrl.VideoDevices["USB"] == null) 
         throw new Exception("No USB video device available"); 
 
      capturectrl.VideoDevices["USB"].Selected = true; 
 
      // reference the capture size collection 
      CaptureSizes sizes = capturectrl.VideoCaptureSizes; 
 
      // get the current selection 
      int n = sizes.Selection; 
 
      // loop through all the capture sizes 
      foreach (CaptureSize cs in sizes) 
      { 
         // check some criteria and select one 
         if (cs.Width == 640 && cs.Height == 480) 
         { 
            // select it and break 
            cs.Selected = true; 
            break; 
         } 
      } 
 
      // set the result to what we expect 
      _result = (n != sizes.Selection); 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
Requirements

Target Platforms

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

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