UseNearestVideoSize
procedure UseNearestVideoSize (PreferredWidth: LongInt; PreferredHeight: LongInt; Stretch: Boolean);
void __fastcall UseNearestVideoSize(System::LongInt PreferredWidth, System::LongInt PreferredHeight, bool Stretch);
public void UseNearestVideoSize(int PreferredWidth, int PreferredHeight, bool Stretch);
Public Sub UseNearestVideoSize(PreferredWidth As Integer, PreferredHeight As Integer, Stretch As Boolean)
void UseNearestVideoSize (int PreferredWidth, int PreferredHeight, BOOL Stretch);
Automatically selects the video capture device size nearest to a preferred width and height:
-
if the Stretch parameter is false, the control is resized to the nearest size found;
-
if the Stretch parameter is true, 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. to get a 320x240 display size with a video capture device that offers only the 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: when this function is called, the VideoSize property is ignored. To re-enable the VideoSize property, call UseNearestVideoSize (0, 0, false).