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

📄 frmexample.frm

📁 image processing example
💻 FRM
字号:
VERSION 5.00
Object = "{30F21E58-B687-11D4-9A46-444553540001}#2.0#0"; "ImageFX.ocx"
Begin VB.Form frmExample 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Image FX Control (OCX) Example"
   ClientHeight    =   3255
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8055
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmExample.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3255
   ScaleWidth      =   8055
   StartUpPosition =   3  'Windows Default
   Begin Image燜X.ImageFX ImageFX1 
      Left            =   120
      Top             =   480
      _ExtentX        =   7673
      _ExtentY        =   3678
   End
   Begin VB.CommandButton cmdReset 
      Caption         =   "Reset"
      Height          =   255
      Left            =   6240
      TabIndex        =   23
      Top             =   480
      Width           =   735
   End
   Begin VB.CommandButton cmdColorize 
      Caption         =   "Colorize"
      Height          =   255
      Left            =   7080
      TabIndex        =   22
      Top             =   480
      Width           =   735
   End
   Begin VB.CommandButton cmdFlipH 
      Caption         =   "Flip Horizontal"
      Height          =   255
      Left            =   5760
      TabIndex        =   21
      Top             =   1200
      Width           =   1215
   End
   Begin VB.CommandButton cmdGray 
      Caption         =   "Gray"
      Height          =   255
      Left            =   5040
      TabIndex        =   20
      Top             =   840
      Width           =   615
   End
   Begin VB.VScrollBar VScroll1 
      Height          =   255
      Left            =   5640
      Max             =   1
      Min             =   3
      TabIndex        =   19
      Top             =   480
      Value           =   1
      Width           =   255
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1005
      Index           =   3
      Left            =   360
      Picture         =   "frmExample.frx":08CA
      ScaleHeight     =   975
      ScaleWidth      =   1080
      TabIndex        =   15
      Top             =   2040
      Width           =   1110
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1005
      Index           =   4
      Left            =   1560
      Picture         =   "frmExample.frx":2C5F
      ScaleHeight     =   975
      ScaleWidth      =   1080
      TabIndex        =   14
      Top             =   2040
      Width           =   1110
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1005
      Index           =   5
      Left            =   2760
      Picture         =   "frmExample.frx":511A
      ScaleHeight     =   975
      ScaleWidth      =   1080
      TabIndex        =   13
      Top             =   2040
      Width           =   1110
   End
   Begin VB.CommandButton cmdInvert 
      Caption         =   "Invert Colors"
      Height          =   255
      Left            =   5760
      TabIndex        =   12
      Top             =   840
      Width           =   1215
   End
   Begin VB.CommandButton cmdNoise 
      Caption         =   "Noise"
      Height          =   255
      Left            =   7080
      TabIndex        =   11
      Top             =   840
      Width           =   735
   End
   Begin VB.CommandButton cmdBlur 
      Caption         =   "Blur"
      Height          =   255
      Left            =   5040
      TabIndex        =   9
      Top             =   1200
      Width           =   615
   End
   Begin VB.CommandButton cmdMosaic 
      Caption         =   "Mosaic"
      Height          =   255
      Left            =   7080
      TabIndex        =   8
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton cmdDarken 
      Caption         =   "Darken"
      Height          =   255
      Left            =   4200
      TabIndex        =   7
      Top             =   1200
      Width           =   735
   End
   Begin VB.CommandButton cmdLighten 
      Caption         =   "Lighten"
      Height          =   255
      Left            =   4200
      TabIndex        =   6
      Top             =   840
      Width           =   735
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1005
      Index           =   2
      Left            =   2760
      Picture         =   "frmExample.frx":7027
      ScaleHeight     =   975
      ScaleWidth      =   1080
      TabIndex        =   3
      Top             =   480
      Width           =   1110
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1005
      Index           =   1
      Left            =   1560
      Picture         =   "frmExample.frx":8F34
      ScaleHeight     =   975
      ScaleWidth      =   1080
      TabIndex        =   2
      Top             =   480
      Width           =   1110
   End
   Begin VB.PictureBox pic1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1005
      Index           =   0
      Left            =   360
      Picture         =   "frmExample.frx":B3EF
      ScaleHeight     =   975
      ScaleWidth      =   1080
      TabIndex        =   0
      Top             =   480
      Width           =   1110
   End
   Begin VB.Label Num 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "1"
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   5280
      TabIndex        =   18
      Top             =   480
      Width           =   375
   End
   Begin VB.Label lblAbout 
      BackStyle       =   0  'Transparent
      Caption         =   $"frmExample.frx":D784
      Height          =   1215
      Left            =   4200
      TabIndex        =   17
      Top             =   1935
      Width           =   3615
   End
   Begin VB.Label lblHeaderAbout 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   " About"
      Height          =   195
      Left            =   4230
      TabIndex        =   16
      Top             =   1695
      Width           =   480
   End
   Begin VB.Label lblHeaderOriginal 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Original Images"
      Height          =   195
      Left            =   285
      TabIndex        =   10
      Top             =   1695
      Width           =   1110
   End
   Begin VB.Shape Shape5 
      BackStyle       =   1  'Opaque
      Height          =   255
      Left            =   240
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Shape Shape6 
      Height          =   1335
      Left            =   120
      Top             =   1800
      Width           =   3855
   End
   Begin VB.Label lblEditing 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Editing image:"
      Height          =   195
      Left            =   4200
      TabIndex        =   5
      Top             =   480
      Width           =   1005
   End
   Begin VB.Label lblEffects 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   " Image Effects"
      Height          =   195
      Left            =   4230
      TabIndex        =   4
      Top             =   135
      Width           =   1050
   End
   Begin VB.Shape Shape4 
      BackStyle       =   1  'Opaque
      Height          =   255
      Left            =   4200
      Top             =   120
      Width           =   1200
   End
   Begin VB.Shape Shape3 
      Height          =   1335
      Left            =   4080
      Top             =   240
      Width           =   3855
   End
   Begin VB.Label lblImage 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   " Image / Preview"
      Height          =   195
      Left            =   270
      TabIndex        =   1
      Top             =   135
      Width           =   1215
   End
   Begin VB.Shape Shape2 
      BackStyle       =   1  'Opaque
      Height          =   255
      Left            =   240
      Top             =   120
      Width           =   1335
   End
   Begin VB.Shape Shape1 
      Height          =   1335
      Left            =   120
      Top             =   240
      Width           =   3855
   End
   Begin VB.Shape Shape7 
      BackStyle       =   1  'Opaque
      Height          =   255
      Left            =   4200
      Top             =   1680
      Width           =   600
   End
   Begin VB.Shape Shape8 
      Height          =   1335
      Left            =   4080
      Top             =   1800
      Width           =   3855
   End
End
Attribute VB_Name = "frmExample"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'**********************************
'* CODE BY: PATRICK MOORE (ZELDA) *
'* Feel free to re-distribute or  *
'* Use in your own projects.      *
'* Giving credit to me would be   *
'* nice :)                        *
'*                                *
'* Please vote for me if you find *
'* this code useful :]   -Patrick *
'**********************************
'
'PS: Please look for more submissions to PSC by me
'    shortly.  I've recently been working on a lot
'    :))  All my submissions are under author name
'    "Patrick Moore (Zelda)"

Private Sub cmdBlur_Click()
ImageFX1.Blur pic1(Num - 1), 1
End Sub

Private Sub cmdColorize_Click()
Dim col1 As Long, col2 As Long, col3 As Long
'****
'Replace vbGreen with ANY color combination
'Including vb.. colors and RGB(x, x, x) as well
'as the Long color value
'****

ImageFX1.Colorize pic1(Num - 1), vbGreen
End Sub

Private Sub cmdDarken_Click()
ImageFX1.Darken pic1(Num - 1), 15
End Sub

Private Sub cmdFlipH_Click()
ImageFX1.FlipHorizontal pic1(Num - 1)
End Sub

Private Sub cmdGray_Click()
ImageFX1.GrayScale pic1(Num - 1)
End Sub

Private Sub cmdInvert_Click()
ImageFX1.Invert pic1(Num - 1)
End Sub

Private Sub cmdLighten_Click()
ImageFX1.Lighten pic1(Num - 1), 15
End Sub

Private Sub cmdMosaic_Click()
ImageFX1.Pixelate pic1(Num - 1), 3
End Sub

Private Sub cmdNoise_Click()
ImageFX1.AddNoise pic1(Num - 1), 5
End Sub

Private Sub cmdReset_Click()
pic1(Num - 1).PaintPicture pic1(Num + 2), 0, 0, pic1(Num - 1).Width, pic1(Num - 1).Height, 0, 0, pic1(Num - 1).Width, pic1(Num - 1).Height
End Sub

Private Sub Form_Load()
Num = 1
VScroll1.Value = 1
End Sub

Private Sub VScroll1_Change()
Num.Caption = VScroll1.Value
End Sub

⌨️ 快捷键说明

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