Private Sub SetMinimumSize
Dim minCS As CameraSize
For Each cs As CameraSize In camEx.GetSupportedPicturesSizes
If minCS.Width = 0 Then
minCS = cs
Else
If Power(minCS.Width, 2) + Power(minCS.Height, 2) > Power(cs.Width, 2) + Power(cs.Height, 2) Then
minCS = cs
End If
End If
Next
camEx.SetPictureSize(minCS.Width, minCS.Height)
Log("Selected size: " & minCS)
End Sub