UseNearestVideoSize
Delphi
procedure UseNearestVideoSize (PreferredWidth: LongInt; PreferredHeight: LongInt; Stretch: Boolean);
C++Builder
void __fastcall UseNearestVideoSize(System::LongInt PreferredWidth, System::LongInt PreferredHeight, bool Stretch);
C#
public void UseNearestVideoSize(int PreferredWidth, int PreferredHeight, bool Stretch);
VB.NET
Public Sub UseNearestVideoSize(PreferredWidth As Integer, PreferredHeight As Integer, Stretch As Boolean)
C++/Qt
void UseNearestVideoSize (int PreferredWidth, int PreferredHeight, BOOL Stretch);
Used to automatically select the video capture device size nearest to a preferred width and height.
- if stretch is disabled, the control is resized to the nearest size found. - if stretch is enabled, the nearest size is selected, the control is resized to the preferred width and height, and the video window is stretched to fit the control.
E.g. we want a 320x240 display size, and the video capture device offers only 176x144 and 352x288 sizes. - UseNearestVideoSize (320, 240, false) selects the 352x288 video size and resizes the display window to 352x288. - UseNearestVideoSize (320, 240, true) selects the 352x288 video size and stretches the display window to 320x240.
Important note: when this function is called, the VideoSize property is ignored. To re-enable the VideoSize property, call UseNearestVideoSize (0, 0, false).