⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 这是个不错的源程序
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "VB6图像比较分析控件源代码"
   ClientHeight    =   6735
   ClientLeft      =   45
   ClientTop       =   420
   ClientWidth     =   11910
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   449
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   794
   StartUpPosition =   3  '窗口缺省
   Begin VB.ListBox lstChild 
      Height          =   420
      Left            =   3600
      TabIndex        =   14
      Top             =   7800
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.ListBox lstMaster 
      Height          =   420
      Left            =   1560
      TabIndex        =   13
      Top             =   7800
      Visible         =   0   'False
      Width           =   1695
   End
   Begin RichTextLib.RichTextBox rtbMain 
      Height          =   30
      Left            =   1800
      TabIndex        =   12
      Top             =   6720
      Visible         =   0   'False
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   53
      _Version        =   393217
      TextRTF         =   $"frmMain.frx":058A
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   420
      Left            =   0
      TabIndex        =   10
      Top             =   0
      Width           =   11910
      _ExtentX        =   21008
      _ExtentY        =   741
      ButtonWidth     =   609
      ButtonHeight    =   582
      Appearance      =   1
      ImageList       =   "imlToolbarIcons"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   10
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Open"
            Object.ToolTipText     =   "打开"
            ImageKey        =   "Open"
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Save"
            Object.ToolTipText     =   "保存"
            ImageKey        =   "Save"
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Print"
            Object.ToolTipText     =   "打印"
            ImageKey        =   "Print"
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Camera"
            Object.ToolTipText     =   "比较"
            ImageKey        =   "Camera"
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Help"
            Object.ToolTipText     =   "关于"
            ImageKey        =   "Help"
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Mask"
            Object.ToolTipText     =   "使用屏蔽色"
            ImageIndex      =   6
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "DelMask"
            Object.ToolTipText     =   "删除屏蔽色"
            ImageIndex      =   8
         EndProperty
      EndProperty
   End
   Begin VB.PictureBox picChildHidden 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      Height          =   255
      Left            =   1080
      ScaleHeight     =   13
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   6
      Top             =   8160
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox picMasterHidden 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      Height          =   255
      Left            =   720
      ScaleHeight     =   13
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   5
      Top             =   8160
      Visible         =   0   'False
      Width           =   255
   End
   Begin MSComDlg.CommonDialog cdMain 
      Left            =   7680
      Top             =   7920
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton cmdStart 
      Caption         =   "开始比较"
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   6120
      Width           =   1095
   End
   Begin VB.CommandButton cmdChild 
      Caption         =   "载入图片"
      Height          =   375
      Left            =   10320
      TabIndex        =   3
      Top             =   5280
      Width           =   1095
   End
   Begin VB.CommandButton cmdMaster 
      Caption         =   "载入图片"
      Height          =   375
      Left            =   4440
      TabIndex        =   2
      Top             =   5280
      Width           =   1095
   End
   Begin VB.PictureBox picChild 
      AutoSize        =   -1  'True
      Height          =   255
      Left            =   1080
      ScaleHeight     =   13
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   1
      Top             =   7800
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.PictureBox picMaster 
      AutoSize        =   -1  'True
      Height          =   255
      Left            =   720
      ScaleHeight     =   13
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   0
      Top             =   7800
      Visible         =   0   'False
      Width           =   255
   End
   Begin Project1.ASPictureBox2 aspbChild 
      Height          =   4500
      Left            =   6120
      TabIndex        =   7
      Top             =   720
      Width           =   5535
      _ExtentX        =   9763
      _ExtentY        =   7938
      BackColor       =   16777215
   End
   Begin VB.Frame Frame1 
      Height          =   5415
      Left            =   120
      TabIndex        =   8
      Top             =   480
      Width           =   5775
      Begin Project1.ASPictureBox aspbMaster 
         Height          =   4455
         Left            =   120
         TabIndex        =   15
         Top             =   240
         Width           =   5535
         _ExtentX        =   9763
         _ExtentY        =   7858
         BackColor       =   16777215
      End
   End
   Begin VB.Frame Frame2 
      Height          =   5415
      Left            =   6000
      TabIndex        =   9
      Top             =   480
      Width           =   5775
   End
   Begin MSComctlLib.ImageList imlToolbarIcons 
      Left            =   0
      Top             =   6720
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   8
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":0627
            Key             =   "Open"
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":0739
            Key             =   "Save"
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":084B
            Key             =   "Print"
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":095D
            Key             =   "Camera"
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":0A6F
            Key             =   "Help"
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":0B81
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":0FD3
            Key             =   ""
         EndProperty
         BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmMain.frx":116D
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame3 
      Height          =   735
      Left            =   120
      TabIndex        =   11
      Top             =   5880
      Width           =   11655
      Begin MSComctlLib.ProgressBar pbMain 
         Height          =   375
         Left            =   1320
         TabIndex        =   16
         Top             =   240
         Width           =   10155
         _ExtentX        =   17912
         _ExtentY        =   661
         _Version        =   393216
         Appearance      =   1
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim ix As Single, iy As Single
Dim bMask As Boolean
Dim sMFile As String
Dim sCFile As String
Dim bPMask As Boolean
Dim bCMask As Boolean

Private Sub aspbMaster_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    If Button = 1 And bMask = True And sMFile <> "" Then
        ix = X
        iy = Y
    End If
    
End Sub

Private Sub aspbMaster_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = 1 And bMask = True And sMFile <> "" Then
        aspbMaster.DoLine ix, iy, X, Y
        Toolbar1.Buttons(9).Value = tbrUnpressed

        bMask = False
        'create subfile for mask
        'assume it has 3 letter extension as normal
        sTmp = Left$(sMFile, Len(sMFile) - 3) & "msk"
        a = aspbMaster.VSVal
        B = aspbMaster.HSVal
        iy = iy + a
        ix = ix + B
        Y = Y + a
        X = X + B
        If Dir(sTmp, vbNormal) = "" Then
            rtbMain.Text = Str$(ix) & "," & Str$(iy) & "," & Str$(X) & "," & Str$(Y) & vbCrLf
            rtbMain.SaveFile sTmp, rtfText
        Else
            rtbMain.LoadFile sTmp, rtfText
            rtbMain.Text = rtbMain.Text & Str$(ix) & "," & Str$(iy) & "," & Str$(X) & "," & Str$(Y) & vbCrLf
            rtbMain.SaveFile sTmp, rtfText
        End If
        lstMaster.AddItem Str$(ix) & "," & Str$(iy) & "," & Str$(X) & "," & Str$(Y) & vbCrLf
    End If

End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
    On Error Resume Next
    sChoice = ""
    Select Case Button.Key
        Case "Open"
        frmSelect.Caption = "打开"
        frmSelect.lblMain.Caption = "请选择需要打开的图片."
        frmSelect.Show 1
        Select Case sChoice
            Case "P"
            cmdMaster_Click
            Case "C"
            cmdChild_Click
        End Select
        Case "Save"
        frmSelect.Caption = "保存"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -