Dim XX As Long, TotalFrame As Long, ImageIndex As Long
Dim WW As Long
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim TmpStr As String
Dim Pos As Integer, Pos2 As Integer
On Error GoTo ErrRow
Cmdlg.ShowOpen
TmpStr = Cmdlg.FileName
Pos = InStr(TmpStr, "_")
Pos2 = InStrRev(TmpStr, ".")
TotalFrame = CInt(Mid(TmpStr, Pos + 1, Pos2 - Pos - 1))
LoadImageFileRmOSD TmpStr, TotalFrame
Text1.Text = 250: Text2.Text = 150
ErrRow:
End Sub
Private Sub Command2_Click()
ShellExecute Me.hwnd, "open", App.Path & "\SDK_OSD.htm", vbNullString, vbNullString, 0
End Sub
Private Sub Form_Load()
SetRegSn ""
If InitRmOSD < 0 Then MsgBox "初始化失败!", vbInformation, "提示"
XX = 610
TotalFrame = 6
ImageIndex = 0
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
FreeRmOSD
End Sub
Private Sub HVol_Change()
ChangeVolumeRmOSD CInt(Text3.Text), CInt(Text4.Text), HVol.Value
End Sub
Private Sub HVol_Scroll()
ChangeVolumeRmOSD CInt(Text3.Text), CInt(Text4.Text), HVol.Value
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Timer1_Timer()
ClearBufferRmOSD
XX = XX - 10
WW = GetWidthOSDTextRmOSD(TxtChar.Text)
If XX < -WW Then XX = 601
AddOsdTextItemsRmOSD XX, 120, 30, TxtChar.Text, "宋体", RGB(0, 0, 255), RGB(0, 0, 0)
AddOsdTextItemsRmOSD XX, 220, 30, TxtChar.Text, "宋体", RGB(255, 0, 0), RGB(0, 0, 0)
AddOsdTextItemsRmOSD XX, 320, 30, TxtChar.Text, "宋体", RGB(255, 255, 0), RGB(255, 0, 0)
SetImagePropertyRmOSD CInt(Text1.Text), CInt(Text2.Text), ImageIndex, True, True
ImageIndex = ImageIndex + 1
If TotalFrame > 0 Then ImageIndex = ImageIndex Mod TotalFrame
UpdateBufferRmOSD
End Sub