📄 logomanager2.frm
字号:
VERSION 5.00
Object = "{997F88E9-8CA8-4FD7-A3C6-F411CF22CD7C}#43.0#0"; "MFBUS15.OCX"
Begin VB.Form frmLogoManager
Caption = "MyLogo Manager"
ClientHeight = 3720
ClientLeft = 60
ClientTop = 345
ClientWidth = 6465
LinkTopic = "Form1"
ScaleHeight = 3720
ScaleWidth = 6465
StartUpPosition = 3 'Windows Default
Begin MFBUS15.MFBUS15Control MobileFBUSControl1
Height = 480
Left = 4800
TabIndex = 11
Top = 120
Width = 480
_ExtentX = 847
_ExtentY = 847
End
Begin VB.CommandButton cmdClear
Caption = "Clear "
Height = 495
Left = 4680
TabIndex = 10
Top = 2040
Width = 1215
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H80000005&
FillStyle = 0 'Solid
Height = 1260
Left = 120
ScaleHeight = 80
ScaleMode = 3 'Pixel
ScaleWidth = 389
TabIndex = 9
Top = 600
Width = 5895
End
Begin VB.Frame Frame1
Height = 1695
Left = 240
TabIndex = 3
Top = 1920
Width = 3375
Begin VB.CommandButton cmdopen
Caption = "Open File"
Height = 375
Left = 120
TabIndex = 8
Top = 240
Width = 1215
End
Begin VB.TextBox txttujuansms
Height = 375
Left = 1440
TabIndex = 6
Top = 960
Width = 1575
End
Begin VB.CommandButton cmdupload
Caption = "Upload"
Height = 375
Left = 120
TabIndex = 5
Top = 600
Width = 1215
End
Begin VB.CommandButton cmdsms
Caption = "send As SMS"
Height = 375
Left = 120
TabIndex = 4
Top = 960
Width = 1215
End
Begin VB.Label Label3
Caption = "phone number"
Height = 255
Left = 1680
TabIndex = 7
Top = 1320
Width = 1335
End
End
Begin VB.ComboBox Combo1
Height = 315
Left = 1080
TabIndex = 0
Text = "COM1"
Top = 120
Width = 1695
End
Begin VB.Label lblstatus
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "not connected"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2880
TabIndex = 2
Top = 120
Width = 1575
End
Begin VB.Label Label1
Caption = "Connect"
Height = 255
Left = 360
TabIndex = 1
Top = 120
Width = 735
End
End
Attribute VB_Name = "frmLogoManager"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private bPaint As Boolean
Private Sub cmdClear_Click()
Picture1.Cls
End Sub
Private Sub cmdopen_Click()
Dim sFile As String
Screen.MousePointer = vbHourglass
sFile = InputBox("Masukkan Lokasi dan Nama File", "MyLogoManager")
If InStr(sFile, "\") = 0 Then sFile = App.Path & "\" & sFile
MobileFBUSControl1.Logo.ReadFile sFile
PaintLogo
End Sub
Private Sub cmdSms_Click()
With MobileFBUSControl1.Logo
.SendAsSMS txttujuansms.Text
End With
End Sub
Private Sub cmdUpload_Click()
Dim X As Integer, Y As Integer
On Error Resume Next
Screen.MousePointer = vbHourglass
With MobileFBUSControl1.Logo
.Upload
End With
Screen.MousePointer = vbDefault
End Sub
Private Sub Combo1_Click()
On Error Resume Next
MobileFBUSControl1.Connect Combo1.Text
MobileFBUSControl1.AnimateLogo = False
With MobileFBUSControl1
.Logo.ReadFile App.Path & "\blank.nlm"
.Logo.LogoType = fbOperatorLogo
PaintLogo
End With
Screen.MousePointer = vbDefault
If MobileFBUSControl1.Connected Then
lblstatus.Caption = "Connected"
Else
lblstatus.Caption = "Not Connected"
End If
End Sub
Private Sub Form_Load()
With Combo1
.AddItem "COM1"
.AddItem "COM2"
.AddItem "COM3"
.AddItem "COM4"
End With
End Sub
Public Sub PaintLogo()
Dim ix As Integer, iy As Integer
Dim px As Long, py As Long, r As Long
Screen.MousePointer = vbHourglass
Picture1.Visible = False
Picture1.Cls
With MobileFBUSControl1.Logo
If .Width > 0 And .Height > 0 Then
Picture1.FillColor = 0
Picture1.ForeColor = 0
ix = Picture1.ScaleWidth / (2 * .Width)
iy = Picture1.ScaleHeight / (2 * .Height)
r = IIf(ix < iy, ix, iy)
If r < 1 Then r = 1
For iy = 0 To .Height - 1
py = r + (iy * Picture1.ScaleHeight) / .Height
For ix = 0 To .Width - 1
px = r + (ix * Picture1.ScaleWidth) / .Width
If .Pixel(ix, iy) = 0 Then
Picture1.Circle (px, py), r
End If
Next ix
Next iy
End If
End With
Picture1.Visible = True
Screen.MousePointer = vbDefault
End Sub
Private Sub MobileFBUSControl1_LogoAnimation(ByVal iFrame As Integer, ByVal iTotalFrames As Integer)
PaintLogo
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ix As Integer, iy As Integer
Dim px As Long, py As Long, r As Long
If (Button And 1) = 1 Then
With MobileFBUSControl1.Logo
If .Width > 0 And .Height > 0 Then
ix = Picture1.ScaleWidth / (2 * .Width)
iy = Picture1.ScaleHeight / (2 * .Height)
r = IIf(ix < iy, ix, iy)
If r < 1 Then r = 1
iy = ((Y - r) * .Height) / Picture1.ScaleHeight
ix = ((X - r) * .Width) / Picture1.ScaleWidth
py = r + (iy * Picture1.ScaleHeight) / .Height
px = r + (ix * Picture1.ScaleWidth) / .Width
bPaint = (.Pixel(ix, iy) <> 0)
End If
End With
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ix As Integer, iy As Integer
Dim px As Long, py As Long, r As Long
If (Button And 1) = 1 Then
With MobileFBUSControl1.Logo
If .Width > 0 And .Height > 0 Then
ix = Picture1.ScaleWidth / (2 * .Width)
iy = Picture1.ScaleHeight / (2 * .Height)
r = IIf(ix < iy, ix, iy)
If r < 1 Then r = 1
iy = ((Y - r) * .Height) / Picture1.ScaleHeight
ix = ((X - r) * .Width) / Picture1.ScaleWidth
py = r + (iy * Picture1.ScaleHeight) / .Height
px = r + (ix * Picture1.ScaleWidth) / .Width
.Pixel(ix, iy) = IIf(bPaint, 0, 1)
If bPaint Then
Picture1.FillColor = 0
Picture1.ForeColor = 0
Else
Picture1.FillColor = Picture1.BackColor
Picture1.ForeColor = Picture1.BackColor
End If
Picture1.Circle (px, py), r
End If
End With
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1_MouseMove Button, Shift, X, Y
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -