📄 frmoptions.frm
字号:
End If
If gmin > 0 Then
mystr2 = Format$(gmin, "绿色最小值:####")
ElseIf gmin = 0 Then
mystr2 = Format$("绿色最小值:0")
Else
mystr2 = Format$("绿色最小值:错误")
End If
mystr3 = mystr3 & vbCrLf & mystr1 & vbCrLf & mystr2
'B
If bmax > 0 Then
mystr1 = Format$(bmax, "蓝色最大值:####")
ElseIf bmax = 0 Then
mystr1 = Format$(0, "蓝色最大值:####")
Else
mystr1 = Format$("蓝色最大值:错误")
End If
If bmin > 0 Then
mystr2 = Format$(bmin, "蓝色最小值:####")
ElseIf bmin = 0 Then
mystr2 = Format$("蓝色最小值:0")
Else
mystr2 = Format$("蓝色最小值:错误")
End If
mystr3 = mystr3 & vbCrLf & mystr1 & vbCrLf & mystr2
VideoData.Text = "32bit模式:" & vbCrLf & mystr3
' 24位
ElseIf info.nColor = 24 Then
rmin = pdest(2)
rmax = rmin
gmin = pdest(1)
gmax = gmin
bmin = pdest(0)
bmax = bmin
For i = 2 To cutlen - 1 Step 3 ' R
If pdest(i) > rmax Then
rmax = pdest(i)
ElseIf pdest(i) < rmin Then
rmin = pdest(i)
End If
Next i
For i = 1 To cutlen - 1 Step 3 ' G
If pdest(i) > gmax Then
gmax = pdest(i)
ElseIf pdest(i) < gmin Then
gmin = pdest(i)
End If
Next i
For i = 0 To cutlen - 1 Step 3 ' B
If pdest(i) > bmax Then
bmax = pdest(i)
ElseIf pdest(i) < bmin Then
bmin = pdest(i)
End If
Next i
'R
If rmax > 0 Then
mystr1 = Format$(rmax, "红色最大值:####")
ElseIf rmax = 0 Then
mystr1 = Format$("红色最大值:0")
Else
mystr1 = Format$("红色最大值:错误")
End If
If rmin > 0 Then
mystr2 = Format$(rmin, "红色最小值:####")
ElseIf rmin = 0 Then
mystr2 = Format$("红色最小值:0")
Else
mystr2 = Format$("红色最小值:错误")
End If
mystr3 = mystr1 & vbCrLf & mystr2
'G
If gmax > 0 Then
mystr1 = Format$(gmax, "绿色最大值:###")
ElseIf gmax = 0 Then
mystr1 = Format$("绿色最大值:0")
Else
mystr1 = Format$("绿色最大值:错误")
End If
If gmin > 0 Then
mystr2 = Format$(gmin, "绿色最小值:####")
ElseIf gmin = 0 Then
mystr2 = Format$("绿色最小值:0")
Else
mystr2 = Format$("绿色最小值:错误")
End If
mystr3 = mystr3 & vbCrLf & mystr1 & vbCrLf & mystr2
'B
If bmax > 0 Then
mystr1 = Format$(bmax, "蓝色最大值:####")
ElseIf bmax = 0 Then
mystr1 = Format$(0, "蓝色最大值:####")
Else
mystr1 = Format$("蓝色最大值:错误")
End If
If bmin > 0 Then
mystr2 = Format$(bmin, "蓝色最小值:####")
ElseIf bmin = 0 Then
mystr2 = Format$("蓝色最小值:0")
Else
mystr2 = Format$("蓝色最小值:错误")
End If
mystr3 = mystr3 & vbCrLf & mystr1 & vbCrLf & mystr2
VideoData.Text = "24bit模式:" & vbCrLf & mystr3
Else
VideoData.Text = "请在8位、24位或32位采集模式下使用此功能!"
End If
End Sub
Private Sub GetDot_Click()
bIsReadData = Not bIsReadData
If bIsReadData = True Then
Unload Me
Else
GetDot.Caption = "逐点读取"
End If
End Sub
Private Sub Green_Click()
BrtSld.Value = MV_GetDeviceParameter(hDevice, ADJUST_G_LUM) '获得绿路亮度值
CtrstSld.Value = MV_GetDeviceParameter(hDevice, ADJUST_G_COARSE) '获得绿路对比度值
End Sub
Private Sub HTotalScr_Change()
MV_SetDeviceParameter hDevice, GARB_WHOLEWIDTH, HTotalScr.Value '设置视频信号水平总点数
HTotal.Text = HTotalScr.Value
End Sub
Private Sub Jpeg_Click()
Monochrome.Enabled = True
Colorful.Enabled = True
Colorful.Value = True
JpgQult.Enabled = True
RGB15.Enabled = True
RGB16.Enabled = True
Check1.Enabled = True
End Sub
Private Sub Monochrome_Click()
Monochrome.Value = True
RGB15.Enabled = False
RGB16.Enabled = False
End Sub
Private Sub NTSC_MouseDown(Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)
MV_SetDeviceParameter hDevice, ADJUST_STANDARD, 1 '设置视频源制式为NTSC制
Form1.DispArea.Refresh
End Sub
Private Sub OnField_Click()
If nBoardType = LEVIN_M10 Or nBoardType = LEVIN_M20 Or nBoardType = LEVIN_RGB10 Or nBoardType = LEVIN_RGB20 Then
MV_SetDeviceParameter hDevice, WORK_SKIP, 0 '设置跳行采集
Else
MV_SetDeviceParameter hDevice, WORK_FIELD, 1 '设置按场采集方式
End If
bOnField = True
Form1.DispArea.Refresh
End Sub
Private Sub OnFrame_Click()
If nBoardType = LEVIN_M10 Or nBoardType = LEVIN_M20 Or nBoardType = LEVIN_RGB10 Or nBoardType = LEVIN_RGB20 Then
MV_SetDeviceParameter hDevice, WORK_SKIP, 1 '设置不跳行采集
Else
MV_SetDeviceParameter hDevice, WORK_FIELD, 0 '设置按帧采集方式
End If
bOnField = False
Form1.DispArea.Refresh
End Sub
Private Sub OtherCParm_Click()
OtherCForm.Show 1
'Unload Me
End Sub
Private Sub PAL_MouseDown(Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)
MV_SetDeviceParameter hDevice, ADJUST_STANDARD, 0 '设置视频源制式为PAL制
Form1.DispArea.Refresh
End Sub
Private Sub Red_Click()
BrtSld.Value = MV_GetDeviceParameter(hDevice, ADJUST_R_LUM) '获得红路亮度值
CtrstSld.Value = MV_GetDeviceParameter(hDevice, ADJUST_R_COARSE) '获得红路对比度值
End Sub
Private Sub RGB15_Click()
RGB15.Value = True
RGB16.Value = False
End Sub
Private Sub RGB16_Click()
RGB16.Value = True
RGB15.Value = False
End Sub
Private Sub SetParametor_Click()
Dim i As Integer
For i = 0 To SetParametor.Tabs.Count - 1
If i = SetParametor.SelectedItem.Index - 1 Then
picOptions(i).Left = 210
picOptions(i).Enabled = True
Else
picOptions(i).Left = -20000
picOptions(i).Enabled = False
End If
Next
End Sub
Private Sub Txt_Click()
Monochrome.Enabled = False
Colorful.Enabled = False
RGB15.Enabled = False
RGB16.Enabled = False
JpgQult.Enabled = False
Check1.Enabled = False
End Sub
Private Sub UpdwonCh_Click()
If UpdwonCh.Value = 0 Then
MV_SetDeviceParameter hDevice, WORK_UPDOWN, 0 '设置视频图像不上下翻转
Else
MV_SetDeviceParameter hDevice, WORK_UPDOWN, 1 '设置视频图像上下翻转
End If
End Sub
Private Sub XShiftScr_Change()
MV_SetDeviceParameter hDevice, GARB_XOFF, XShiftScr.Value '设置视频信号水平偏移
XShift.Text = XShiftScr.Value
End Sub
Private Sub YShiftScr_Change()
MV_SetDeviceParameter hDevice, GARB_YOFF, YShiftScr.Value '设置视频信号垂直偏移
YShift.Text = YShiftScr.Value
End Sub
Private Sub GetParmator() ' called by: form_load
Dim val As Long
'HScroll1.Value = Index
'HScroll1.Max = nAmount - 1
' PAL/NTSC
If MV_GetDeviceParameter(hDevice, ADJUST_STANDARD) = 0 Then
PAL.Value = True
Else
NTSC.Value = True
End If
' RGB通道
If nBoardType = LEVIN_RGB10 Or nBoardType = LEVIN_RGB20 _
Or nBoardType = LEVIN_VGA100 Or nBoardType = LEVIN_VGA170 Then
Red.Enabled = True
Red.Value = True
Green.Enabled = True
Blue.Enabled = True
Else
Red.Enabled = False
Green.Enabled = False
Blue.Enabled = False
End If
' 4个视频通道
val = MV_GetDeviceParameter(hDevice, ADJUST_CHANNEL)
Select Case val
Case 0: Channel1.Value = True
Case 1: Channel2.Value = True
Case 2: Channel3.Value = True
Case 3: Channel4.Value = True
End Select
' directx/GDI/DShow
val = MV_GetDeviceParameter(hDevice, BUFFERTYPE)
Select Case val
Case 0: DirectX.Value = True
Case 1: GDI.Value = True
Case 2: DirectShow.Value = True
End Select
'设置每款板卡对应的控件数值
If nBoardType = LEVIN_M10 Or nBoardType = LEVIN_M20 _
Or nBoardType = LEVIN_RGB10 Or nBoardType = LEVIN_RGB20 _
Or nBoardType = LEVIN_VGA100 Or nBoardType = LEVIN_VGA170 Then
val = MV_GetDeviceParameter(hDevice, WORK_SKIP)
Select Case val
Case 1: OnFrame.Value = True
Case 0: OnField.Value = True
End Select
OtherCParm.Enabled = False
CptWdth.Text = MV_GetDeviceParameter(hDevice, GARB_WIDTH)
CptHght.Text = MV_GetDeviceParameter(hDevice, GARB_HEIGHT)
DspWdth.Text = MV_GetDeviceParameter(hDevice, DISP_WIDTH)
DspHght.Text = MV_GetDeviceParameter(hDevice, DISP_HEIGHT)
ElseIf nBoardType = V3A Or nBoardType = V300 Then
val = MV_GetDeviceParameter(hDevice, WORK_FIELD)
Select Case val
Case 0: OnFrame.Value = True
Case 1: OnField.Value = True
End Select
OtherCParm.Enabled = True
CptWdth.Text = MV_GetDeviceParameter(hDevice, GARB_IN_WIDTH)
CptHght.Text = MV_GetDeviceParameter(hDevice, GARB_IN_HEIGHT)
DspWdth.Text = MV_GetDeviceParameter(hDevice, GARB_WIDTH)
DspHght.Text = MV_GetDeviceParameter(hDevice, GARB_HEIGHT)
Else
val = MV_GetDeviceParameter(hDevice, WORK_FIELD)
Select Case val
Case 0: OnFrame.Value = True
Case 1: OnField.Value = True
End Select
OtherCParm.Enabled = True
CptWdth.Text = MV_GetDeviceParameter(hDevice, GARB_IN_WIDTH)
CptHght.Text = MV_GetDeviceParameter(hDevice, GARB_IN_HEIGHT)
DspWdth.Text = MV_GetDeviceParameter(hDevice, GARB_WIDTH)
DspHght.Text = MV_GetDeviceParameter(hDevice, GARB_HEIGHT)
End If
' 杂项
If nBoardType = V110 Or nBoardType = MOKAC10 Or nBoardType = S100 Or nBoardType = V8T Then
FlipCh.Enabled = False
HTotalScr.Enabled = False
HTotal.Enabled = False
ElseIf nBoardType = V3A Or nBoardType = V300 Or nBoardType = V200 Or nBoardType = V120 Or nBoardType = MOKAC20 _
Or nBoardType = V500 Or nBoardType = V510 Or nBoardType = V520 Or nBoardType = V410 _
Or nBoardType = X400 Or nBoardType = X800 Or nBoardType = E410 Or nBoardType = E450 _
Or nBoardType = MOKAC41 Or nBoardType = S400S420 Or nBoardType = S450 Then
HTotalScr.Enabled = False
HTotal.Enabled = False
FlipCh.Enabled = True
'FlipCh.Value = MV_GetDeviceParameter(hDevice, WORK_FLIP)
ElseIf nBoardType = MOKAC40 Then
FlipCh.Enabled = False
HTotalScr.Enabled = False
HTotal.Enabled = False
ElseIf nBoardType = V400 Then
FlipCh.Enabled = False
HTotalScr.Enabled = True
'HTotalScr.Value = MV_GetDeviceParameter(hDevice, GARB_WHOLEWIDTH)
HTotal.Text = HTotalScr.Value
Else
FlipCh.Enabled = True
'FlipCh.Value = MV_GetDeviceParameter(hDevice, WORK_FLIP)
HTotalScr.Enabled = True
'HTotalScr.Value = MV_GetDeviceParameter(hDevice, GARB_WHOLEWIDTH)
HTotal.Text = HTotalScr.Value
End If
BrtSld.Value = MV_GetDeviceParameter(hDevice, ADJUST_R_LUM)
CtrstSld.Value = MV_GetDeviceParameter(hDevice, ADJUST_R_COARSE)
Select Case nFileFmt
Case 0: Bmp.Value = True
Colorful.Enabled = False
Monochrome.Enabled = False
RGB15.Enabled = False
RGB16.Enabled = False
JpgQult.Enabled = False
Case 1: Jpeg.Value = True
Colorful.Enabled = True
Monochrome.Enabled = True
JpgQult.Enabled = True
Colorful.Value = bIsColor
RGB15.Enabled = Colorful.Value
RGB16.Enabled = Colorful.Value
Case 2: Txt.Value = True
Colorful.Enabled = False
Monochrome.Enabled = False
RGB15.Enabled = False
RGB16.Enabled = False
JpgQult.Enabled = False
End Select
JpgQult.Text = nQuality
FrmNum.Text = nFrmNo
FileDir.Text = strFileDir
DataX.Text = 0
DataY.Text = 0
DataWidth = CptWdth.Text
DataHeight = CptHght.Text
VideoData.Text = ""
If bSaveFilePro = False Then
Check1.Value = 0
Else
Check1.Value = 1
End If
If bIsReadData = True Then
GetDot.Caption = "取消逐点读取"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -