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

📄 form1.frm

📁 点校正工具
💻 FRM
📖 第 1 页 / 共 3 页
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   0  'None
   Caption         =   "调屏助手"
   ClientHeight    =   10200
   ClientLeft      =   675
   ClientTop       =   300
   ClientWidth     =   8700
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   680
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   580
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox Text17 
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   3720
      TabIndex        =   43
      Text            =   "2"
      Top             =   480
      Width           =   495
   End
   Begin VB.TextBox Text16 
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   3120
      TabIndex        =   42
      Text            =   "2"
      Top             =   480
      Width           =   495
   End
   Begin VB.CommandButton test 
      Caption         =   "TEST"
      Height          =   435
      Left            =   2400
      TabIndex        =   41
      Top             =   1020
      Width           =   855
   End
   Begin VB.TextBox Text15 
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   3720
      MaxLength       =   255
      TabIndex        =   40
      Text            =   "192"
      Top             =   60
      Width           =   495
   End
   Begin VB.TextBox Text14 
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   3120
      MaxLength       =   255
      TabIndex        =   39
      Text            =   "192"
      Top             =   60
      Width           =   495
   End
   Begin VB.TextBox Text8 
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   4320
      MaxLength       =   255
      TabIndex        =   37
      Text            =   "192"
      Top             =   60
      Width           =   495
   End
   Begin VB.TextBox Text9 
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   4320
      TabIndex        =   36
      Text            =   "2"
      Top             =   480
      Width           =   495
   End
   Begin VB.TextBox Text10 
      Height          =   375
      Left            =   4200
      TabIndex        =   35
      Text            =   "64"
      Top             =   960
      Width           =   615
   End
   Begin VB.TextBox Text11 
      Height          =   375
      Left            =   4200
      TabIndex        =   34
      Text            =   "48"
      Top             =   1440
      Width           =   615
   End
   Begin VB.CommandButton Command10 
      Caption         =   "退出"
      Height          =   315
      Left            =   7380
      TabIndex        =   27
      Top             =   1800
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "右下"
      Height          =   315
      Left            =   180
      TabIndex        =   25
      Top             =   540
      Width           =   555
   End
   Begin VB.CommandButton Command1 
      Caption         =   "左上"
      Height          =   315
      Left            =   180
      TabIndex        =   24
      Top             =   120
      Width           =   555
   End
   Begin VB.CommandButton Command7 
      Caption         =   "粘贴图片"
      Height          =   375
      Left            =   7380
      TabIndex        =   23
      Top             =   960
      Width           =   975
   End
   Begin VB.TextBox Text13 
      Height          =   375
      Left            =   6120
      TabIndex        =   21
      Text            =   "A1"
      Top             =   960
      Width           =   915
   End
   Begin VB.TextBox Text12 
      Height          =   375
      Left            =   6120
      TabIndex        =   18
      Text            =   "KONKA"
      Top             =   1440
      Width           =   915
   End
   Begin VB.OptionButton Option1 
      Caption         =   "单点"
      Height          =   195
      Left            =   4260
      TabIndex        =   17
      Top             =   1920
      Width           =   675
   End
   Begin VB.OptionButton Option2 
      Caption         =   "2x2"
      Height          =   195
      Left            =   4980
      TabIndex        =   16
      Top             =   1920
      Width           =   615
   End
   Begin VB.OptionButton Option3 
      Caption         =   "4x4"
      Height          =   195
      Left            =   5760
      TabIndex        =   15
      Top             =   1920
      Width           =   615
   End
   Begin VB.OptionButton Option4 
      Caption         =   "8x8"
      Height          =   195
      Left            =   6480
      TabIndex        =   14
      Top             =   1920
      Value           =   -1  'True
      Width           =   615
   End
   Begin VB.CommandButton Command6 
      Caption         =   "生成文件"
      Height          =   375
      Left            =   7380
      TabIndex        =   10
      Top             =   1380
      Width           =   975
   End
   Begin VB.TextBox Text7 
      BorderStyle     =   0  'None
      Height          =   1320
      Left            =   0
      MultiLine       =   -1  'True
      TabIndex        =   6
      Top             =   8760
      Width           =   8640
   End
   Begin VB.TextBox Text6 
      Enabled         =   0   'False
      Height          =   375
      Left            =   780
      TabIndex        =   5
      Text            =   "6"
      Top             =   1080
      Width           =   615
   End
   Begin VB.TextBox Text5 
      Enabled         =   0   'False
      Height          =   375
      Left            =   1620
      TabIndex        =   4
      Text            =   "8"
      Top             =   1080
      Width           =   615
   End
   Begin VB.Timer Timer3 
      Enabled         =   0   'False
      Left            =   180
      Top             =   0
   End
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Left            =   240
      Top             =   0
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   1620
      TabIndex        =   3
      Text            =   "0"
      Top             =   600
      Width           =   615
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   780
      TabIndex        =   2
      Text            =   "0"
      Top             =   600
      Width           =   615
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1620
      TabIndex        =   1
      Text            =   "0"
      Top             =   120
      Width           =   615
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   780
      TabIndex        =   0
      Text            =   "0"
      Top             =   120
      Width           =   615
   End
   Begin VB.Timer Timer1 
      Left            =   60
      Top             =   60
   End
   Begin VB.Label Label17 
      Caption         =   "调屏助手:杨高志"
      Height          =   1635
      Left            =   8460
      TabIndex        =   38
      Top             =   300
      Width           =   255
   End
   Begin VB.Label Label8 
      Caption         =   "校正系数"
      Height          =   195
      Left            =   2280
      TabIndex        =   33
      Top             =   600
      Width           =   735
   End
   Begin VB.Label Label16 
      Caption         =   "校正窗口行列"
      Height          =   375
      Left            =   120
      TabIndex        =   32
      Top             =   1080
      Width           =   615
   End
   Begin VB.Label Label15 
      Height          =   615
      Left            =   180
      TabIndex        =   31
      Top             =   1560
      Width           =   3075
   End
   Begin VB.Label Label14 
      Caption         =   "蓝色"
      Height          =   195
      Left            =   7320
      TabIndex        =   30
      Top             =   600
      Width           =   1035
   End
   Begin VB.Label Label4 
      Caption         =   "绿色"
      Height          =   195
      Left            =   7320
      TabIndex        =   29
      Top             =   360
      Width           =   1035
   End
   Begin VB.Label Label3 
      Caption         =   "红色"
      Height          =   195
      Left            =   7320
      TabIndex        =   28
      Top             =   120
      Width           =   1035
   End
   Begin VB.Label Label5 
      Caption         =   "1"
      Height          =   195
      Left            =   1380
      TabIndex        =   26
      Top             =   60
      Visible         =   0   'False
      Width           =   135
   End
   Begin VB.Image Image1 
      Height          =   6480
      Left            =   0
      Stretch         =   -1  'True
      Top             =   2250
      Width           =   8640
   End
   Begin VB.Label Label2 
      Caption         =   "箱体编号"
      Height          =   195
      Left            =   5280
      TabIndex        =   22
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "生成文件前缀"
      Height          =   255
      Left            =   4980
      TabIndex        =   20
      Top             =   1500
      Width           =   1095
   End
   Begin VB.Label Label6 
      Caption         =   "1"
      Height          =   255
      Left            =   1380
      TabIndex        =   19
      Top             =   60
      Visible         =   0   'False
      Width           =   75
   End
   Begin VB.Label Label13 
      Caption         =   "校正矩阵:"
      Height          =   195
      Left            =   3420
      TabIndex        =   13
      Top             =   1920
      Width           =   735
   End
   Begin VB.Label Label12 
      Caption         =   "箱体高度"
      Height          =   255
      Left            =   3420
      TabIndex        =   12
      Top             =   1500
      Width           =   735
   End
   Begin VB.Label Label11 
      Caption         =   "箱体宽度"
      Height          =   195
      Left            =   3420
      TabIndex        =   11
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label Label10 
      Caption         =   "实际色差和校正色差的放大倍数"
      Height          =   375
      Left            =   4980
      TabIndex        =   9
      Top             =   480
      Width           =   2055
   End
   Begin VB.Label Label9 
      Caption         =   "低过次值的将认为是瞎点不参与计算"
      Height          =   375
      Left            =   4980
      TabIndex        =   8
      Top             =   60
      Width           =   2055
   End
   Begin VB.Label Label7 
      Caption         =   "校正精度"
      Height          =   195
      Left            =   2280
      TabIndex        =   7
      Top             =   120
      Width           =   735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public jz, showxy
Private Type POINTAPI
    X As Long
    Y As Long
End Type

Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Command1_Click()
  Timer2.Enabled = True
  Label15.Caption = "操作提示:2秒内将鼠标放在需校正箱体图片的左上处,软件自动读取图片的左上点坐标.可人工修改坐标值."
End Sub

Private Sub Command10_Click()
Unload Me
End Sub

Private Sub Command2_Click()
Timer3.Enabled = True
Label15.Caption = "操作提示:2秒内将鼠标放在需校正箱体图片的右下处,软件自动读取图片的右下点坐标.可人工修改坐标值."
End Sub

Private Sub Command3_Click()
    Dim tPOS As POINTAPI
    Dim lDC As Long
    Dim sTmp As String
    Dim lColor As Long
    Dim x1, y1, nR, Dhang, Dlie, Chang, Clie, Rda, Rxiao
    Dim Rtemp As Long
       
    lDC = GetWindowDC(0)
    Chang = Val(Label6.Caption)
    Clie = Val(Label5.Caption)
    Text7.Text = ""

    Rda = 0
    Rxiao = 255
    x1 = Val(Text1.Text)
    y1 = Val(Text2.Text)
    nR = 0
    Rtemp = 0
    Dhang = 0
    Dlie = 0
    Do While Dhang < Val(Text6.Text)
       y1 = Val(Text2.Text) + (Dhang * Chang)
    Do While Dlie < Val(Text5.Text)
       x1 = Val(Text1.Text) + (Dlie * Clie)
       y1 = Val(Text2.Text) + (Dhang * Chang)
    Do While y1 < Val(Text2.Text) + ((Dhang + 1) * Chang)
       x1 = Val(Text1.Text) + (Dlie * Clie)
    Do While x1 < Val(Text1.Text) + ((Dlie + 1) * Clie)
    lColor = GetPixel(lDC, x1, y1)
    If Val("&H" & Right$(Hex(lColor), 2)) > Val(Text8.Text) Then
    Rtemp = Rtemp + Val("&H" & Right$(Hex(lColor), 2))
    nR = nR + 1
    End If
    x1 = x1 + 1
 
   Loop
   y1 = y1 + 1
   Loop
   
   If nR > 0 Then
   Rtemp = Rtemp / nR
   End If
   Text7.Text = Text7.Text & Val(Rtemp) & ","
   If Rtemp > Rda And Rtemp > 0 Then
   Rda = Rtemp
   End If
   If Rtemp < Rxiao And Rtemp > 0 Then
   Rxiao = Rtemp
   End If
   Rtemp = 0
   nR = 0
   x1 = x1 - 1
   y1 = y1 - 1
   Dlie = Dlie + 1
   Loop
   Dhang = Dhang + 1
   Dlie = 0
   Loop
    
   If Rxiao = 0 Then
   Rxiao = 255
   Rda = 255
   Else
   Rxiao = 255 - Rda + Rxiao
   End If
    
End Sub

Private Sub Command4_Click()
Dim n
n = 0
Do While n <= Val(Text6.Text)
Form1.Line (Image1.Left, Image1.Top + Val(Label6.Caption) * n)-Step(Image1.Width, 0), RGB(Text8.Text, Text8.Text, Text8.Text)
n = n + 1
Loop
n = 0
Do While n <= Val(Text5.Text)
Form1.Line (Image1.Left + Val(Label5.Caption) * n, Image1.Top)-Step(0, Image1.Height), RGB(Text8.Text, Text8.Text, Text8.Text)
n = n + 1
Loop
End Sub

Private Sub Command5_Click()
  Dim i As Long
  Dim tPOS As POINTAPI
  Dim lDC As Long
  Dim sTmp As String
  Dim lColor As Long
  Dim x1, y1, n, nR, Dhang, Dlie, Rda, Rxiao, Chang, Clie
  Dim Rtemp As Long
        
    lDC = GetWindowDC(0)
    Chang = Val(Label6.Caption)
    Clie = Val(Label5.Caption)
    

    Rda = 0
    Rxiao = 255
    x1 = Val(Text1.Text)
    y1 = Val(Text2.Text)
    n = 0
    nR = 0
    Rtemp = 0
    Dhang = 0
    Dlie = 0
    Do While Dhang < Val(Text6.Text)
       y1 = Val(Text2.Text) + (Dhang * Chang)
    Do While Dlie < Val(Text5.Text)
       x1 = Val(Text1.Text) + (Dlie * Clie)
       y1 = Val(Text2.Text) + (Dhang * Chang)
    Do While y1 < Val(Text2.Text) + ((Dhang + 1) * Chang)
       x1 = Val(Text1.Text) + (Dlie * Clie)
    Do While x1 < Val(Text1.Text) + ((Dlie + 1) * Clie)

⌨️ 快捷键说明

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