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

📄 mfrmmain.frm

📁 Visual Basic image processing. Mainly it occupies some filters to detect some prperties of image. Re
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.MDIForm mfrmMain 
   BackColor       =   &H8000000C&
   Caption         =   "vbaccelerator DIB Section Image Processing Sample"
   ClientHeight    =   7005
   ClientLeft      =   2565
   ClientTop       =   2790
   ClientWidth     =   8190
   Icon            =   "mfrmMain.frx":0000
   LinkTopic       =   "MDIForm1"
   Begin VB.PictureBox picStatus 
      Align           =   2  'Align Bottom
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   0
      ScaleHeight     =   315
      ScaleWidth      =   8190
      TabIndex        =   0
      Top             =   6690
      Width           =   8190
      Begin VBImageProc.ProgressBar prgMain 
         Height          =   255
         Left            =   0
         Top             =   60
         Visible         =   0   'False
         Width           =   5055
         _ExtentX        =   8916
         _ExtentY        =   450
         Smooth          =   -1  'True
         Min             =   1
      End
      Begin VB.Label lblSize 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   6660
         TabIndex        =   3
         Top             =   60
         Width           =   1515
      End
      Begin VB.Label lblImage 
         BorderStyle     =   1  'Fixed Single
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   5100
         TabIndex        =   2
         Top             =   60
         Width           =   1515
      End
      Begin VB.Label lblStatus 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "Ready."
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   0
         TabIndex        =   1
         Top             =   60
         Width           =   5055
      End
   End
   Begin VB.Menu mnuFileTop 
      Caption         =   "&File"
      Begin VB.Menu mnuFile 
         Caption         =   "&Open..."
         Index           =   0
         Shortcut        =   ^O
      End
      Begin VB.Menu mnuFile 
         Caption         =   "&Save..."
         Index           =   1
         Shortcut        =   ^S
      End
      Begin VB.Menu mnuFile 
         Caption         =   "-"
         Index           =   2
      End
      Begin VB.Menu mnuFile 
         Caption         =   "&Print..."
         Index           =   3
         Shortcut        =   ^P
      End
      Begin VB.Menu mnuFile 
         Caption         =   "-"
         Index           =   4
      End
      Begin VB.Menu mnuFile 
         Caption         =   ""
         Index           =   5
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFile 
         Caption         =   ""
         Index           =   6
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFile 
         Caption         =   ""
         Index           =   7
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFile 
         Caption         =   ""
         Index           =   8
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFile 
         Caption         =   "-"
         Index           =   9
         Visible         =   0   'False
      End
      Begin VB.Menu mnuFile 
         Caption         =   "&Close"
         Index           =   10
      End
   End
   Begin VB.Menu mnuEditTOP 
      Caption         =   "&Edit"
      Begin VB.Menu mnuEdit 
         Caption         =   "&Copy"
         Index           =   1
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuEdit 
         Caption         =   "&Paste"
         Index           =   2
         Shortcut        =   ^V
      End
   End
   Begin VB.Menu mnuImageTOP 
      Caption         =   "&Image"
      Begin VB.Menu mnuImage 
         Caption         =   "&Softening Filters"
         Index           =   0
         Begin VB.Menu mnuLowPass 
            Caption         =   "Soften"
            Index           =   0
         End
         Begin VB.Menu mnuLowPass 
            Caption         =   "Soften More"
            Index           =   1
         End
         Begin VB.Menu mnuLowPass 
            Caption         =   "Blur"
            Index           =   2
         End
         Begin VB.Menu mnuLowPass 
            Caption         =   "Blur More"
            Index           =   3
         End
      End
      Begin VB.Menu mnuImage 
         Caption         =   "S&harpening Filters"
         Index           =   1
         Begin VB.Menu mnuHighPass 
            Caption         =   "Sharpen"
            Index           =   0
         End
         Begin VB.Menu mnuHighPass 
            Caption         =   "Sharpen More"
            Index           =   1
         End
         Begin VB.Menu mnuHighPass 
            Caption         =   "Unsharp"
            Index           =   2
         End
      End
      Begin VB.Menu mnuImage 
         Caption         =   "&Special Filters"
         Index           =   2
         Begin VB.Menu mnuSpecial 
            Caption         =   "&Emboss..."
            Index           =   0
         End
         Begin VB.Menu mnuSpecial 
            Caption         =   "-"
            Index           =   1
         End
         Begin VB.Menu mnuSpecial 
            Caption         =   "Add &Noise..."
            Index           =   2
         End
         Begin VB.Menu mnuSpecial 
            Caption         =   "-"
            Index           =   3
         End
         Begin VB.Menu mnuSpecial 
            Caption         =   "Mi&nimum Rank Filter..."
            Index           =   4
         End
         Begin VB.Menu mnuSpecial 
            Caption         =   "Me&dian Rank Filter..."
            Index           =   5
         End
         Begin VB.Menu mnuSpecial 
            Caption         =   "Ma&ximum Rank Filter..."
            Index           =   6
         End
      End
      Begin VB.Menu mnuImage 
         Caption         =   "&Custom Defined Filters..."
         Index           =   3
      End
      Begin VB.Menu mnuImage 
         Caption         =   "-"
         Index           =   4
      End
      Begin VB.Menu mnuImage 
         Caption         =   "&Resample..."
         Index           =   5
      End
      Begin VB.Menu mnuImage 
         Caption         =   "-"
         Index           =   6
      End
      Begin VB.Menu mnuImage 
         Caption         =   "Co&mbine..."
         Index           =   7
      End
   End
   Begin VB.Menu mnuColorTOP 
      Caption         =   "&Colors"
      Begin VB.Menu mnuColors 
         Caption         =   "&Darken..."
         Index           =   0
      End
      Begin VB.Menu mnuColors 
         Caption         =   "&Lighten..."
         Index           =   1
      End
      Begin VB.Menu mnuColors 
         Caption         =   "-"
         Index           =   2
      End
      Begin VB.Menu mnuColors 
         Caption         =   "&Colourise..."
         Index           =   3
      End
      Begin VB.Menu mnuColors 
         Caption         =   "-"
         Index           =   4
      End
      Begin VB.Menu mnuColors 
         Caption         =   "&Negative Image..."
         Index           =   5
      End
      Begin VB.Menu mnuColors 
         Caption         =   "-"
         Index           =   6
      End
      Begin VB.Menu mnuColors 
         Caption         =   "&Gray Scale..."
         Index           =   7
      End
      Begin VB.Menu mnuColors 
         Caption         =   "&B/W (Floyd-Steinberg)..."
         Index           =   8
      End
      Begin VB.Menu mnuColors 
         Caption         =   "&Apply Palette..."
         Index           =   9
      End
   End
   Begin VB.Menu mnuWindowTop 
      Caption         =   "&Window"
      WindowList      =   -1  'True
      Begin VB.Menu mnuWindow 
         Caption         =   "Tile &Horizontally"
         Index           =   0
      End
      Begin VB.Menu mnuWindow 
         Caption         =   "Tile &Vertically"
         Index           =   1
      End
      Begin VB.Menu mnuWindow 
         Caption         =   "&Cascade"
         Index           =   2
      End
      Begin VB.Menu mnuWindow 
         Caption         =   "&Arrange Icons"
         Index           =   3
      End
   End
   Begin VB.Menu mnuHelpTOP 
      Caption         =   "&Help"
      Begin VB.Menu mnuHelp 
         Caption         =   "vbAccelerator on the &Web"
         Index           =   0
         Shortcut        =   {F1}
      End
      Begin VB.Menu mnuHelp 
         Caption         =   "-"
         Index           =   1
      End
      Begin VB.Menu mnuHelp 
         Caption         =   "&About..."
         Index           =   2
      End
   End
End
Attribute VB_Name = "mfrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_cMRU As New cMRUFileList
Private m_bInIDE As Boolean
Private m_lCount As Long

Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Private Const BITSPIXEL = 12         '  Number of bits per pixel
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 Declare Function ShellExecuteForExplore Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, lpParameters As Any, lpDirectory As Any, ByVal nShowCmd As Long) As Long
Public Enum EShellShowConstants
    essSW_HIDE = 0
    essSW_MAXIMIZE = 3
    essSW_MINIMIZE = 6
    essSW_SHOWMAXIMIZED = 3
    essSW_SHOWMINIMIZED = 2
    essSW_SHOWNORMAL = 1
    essSW_SHOWNOACTIVATE = 4
    essSW_SHOWNA = 8
    essSW_SHOWMINNOACTIVE = 7
    essSW_SHOWDEFAULT = 10
    essSW_RESTORE = 9
    essSW_SHOW = 5
End Enum
Private Const ERROR_FILE_NOT_FOUND = 2&
Private Const ERROR_PATH_NOT_FOUND = 3&
Private Const ERROR_BAD_FORMAT = 11&
Private Const SE_ERR_ACCESSDENIED = 5        ' access denied
Private Const SE_ERR_ASSOCINCOMPLETE = 27
Private Const SE_ERR_DDEBUSY = 30
Private Const SE_ERR_DDEFAIL = 29
Private Const SE_ERR_DDETIMEOUT = 28
Private Const SE_ERR_DLLNOTFOUND = 32
Private Const SE_ERR_FNF = 2                ' file not found
Private Const SE_ERR_NOASSOC = 31
Private Const SE_ERR_PNF = 3                ' path not found
Private Const SE_ERR_OOM = 8                ' out of memory
Private Const SE_ERR_SHARE = 26


Private Const MAX_PATH = 260

Public Property Get NewImageIndex() As Long
   m_lCount = m_lCount + 1
   NewImageIndex = m_lCount
End Property

Public Function ShellEx( _
        ByVal sFIle As String, _
        Optional ByVal eShowCmd As EShellShowConstants = essSW_SHOWDEFAULT, _
        Optional ByVal sParameters As String = "", _
        Optional ByVal sDefaultDir As String = "", _
        Optional sOperation As String = "open", _
        Optional Owner As Long = 0 _
    ) As Boolean
Dim lR As Long
Dim lErr As Long, sErr As Long
    If (InStr(UCase$(sFIle), ".EXE") <> 0) Then
        eShowCmd = 0
    End If
    On Error Resume Next
    If (sParameters = "") And (sDefaultDir = "") Then
        lR = ShellExecuteForExplore(Owner, sOperation, sFIle, 0, 0, essSW_SHOWNORMAL)
    Else
        lR = ShellExecute(Owner, sOperation, sFIle, sParameters, sDefaultDir, eShowCmd)
    End If
    If (lR < 0) Or (lR > 32) Then
        ShellEx = True
    Else
        ' raise an appropriate error:
        lErr = vbObjectError + 1048 + lR
        Select Case lR
        Case 0
            lErr = 7: sErr = "Out of memory"
        Case ERROR_FILE_NOT_FOUND
            lErr = 53: sErr = "File not found"
        Case ERROR_PATH_NOT_FOUND
            lErr = 76: sErr = "Path not found"
        Case ERROR_BAD_FORMAT
            sErr = "The executable file is invalid or corrupt"
        Case SE_ERR_ACCESSDENIED
            lErr = 75: sErr = "Path/file access error"
        Case SE_ERR_ASSOCINCOMPLETE
            sErr = "This file type does not have a valid file association."
        Case SE_ERR_DDEBUSY
            lErr = 285: sErr = "The file could not be opened because the target application is busy. Please try again in a moment."
        Case SE_ERR_DDEFAIL
            lErr = 285: sErr = "The file could not be opened because the DDE transaction failed. Please try again in a moment."
        Case SE_ERR_DDETIMEOUT
            lErr = 286: sErr = "The file could not be opened due to time out. Please try again in a moment."
        Case SE_ERR_DLLNOTFOUND

⌨️ 快捷键说明

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