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

📄 form1.frm

📁 把图片缩小压缩成jpg格式并保存到sql数据库
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "图文数据录入"
   ClientHeight    =   7095
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6735
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   473
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   449
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command5 
      Caption         =   "取消"
      Enabled         =   0   'False
      Height          =   330
      Left            =   1800
      TabIndex        =   22
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton Command7 
      Caption         =   "删除"
      Height          =   330
      Left            =   2520
      TabIndex        =   20
      Top             =   2640
      Width           =   735
   End
   Begin VB.CommandButton Command6 
      Caption         =   "修改"
      Height          =   330
      Left            =   3960
      TabIndex        =   19
      Top             =   2640
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Height          =   2490
      Left            =   1800
      TabIndex        =   5
      Top             =   0
      Width           =   4875
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   0
         Left            =   2715
         TabIndex        =   12
         Text            =   " "
         Top             =   180
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   1
         Left            =   2715
         TabIndex        =   11
         Top             =   495
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   2
         Left            =   2715
         TabIndex        =   10
         Top             =   810
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   300
         Index           =   3
         Left            =   2715
         TabIndex        =   9
         Top             =   1140
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   945
         Index           =   4
         Left            =   2715
         TabIndex        =   8
         Top             =   1455
         Width           =   2055
      End
      Begin VB.CommandButton Command1 
         Caption         =   "添加照片"
         Height          =   330
         Left            =   120
         TabIndex        =   7
         Top             =   2085
         Width           =   1380
      End
      Begin VB.PictureBox Picture1 
         AutoRedraw      =   -1  'True
         Height          =   1845
         Left            =   120
         Picture         =   "Form1.frx":0000
         ScaleHeight     =   119
         ScaleMode       =   3  'Pixel
         ScaleWidth      =   88
         TabIndex        =   6
         Top             =   240
         Width           =   1380
      End
      Begin VB.Label Label1 
         Caption         =   "姓    名"
         Height          =   240
         Left            =   1815
         TabIndex        =   17
         Top             =   255
         Width           =   720
      End
      Begin VB.Label Label2 
         Caption         =   "性    别"
         Height          =   240
         Left            =   1815
         TabIndex        =   16
         Top             =   570
         Width           =   810
      End
      Begin VB.Label Label3 
         Caption         =   "年    龄"
         Height          =   210
         Left            =   1815
         TabIndex        =   15
         Top             =   900
         Width           =   720
      End
      Begin VB.Label Label4 
         Caption         =   "工作单位"
         Height          =   300
         Left            =   1815
         TabIndex        =   14
         Top             =   1200
         Width           =   720
      End
      Begin VB.Label Label5 
         Caption         =   "家庭住址"
         Height          =   225
         Left            =   1815
         TabIndex        =   13
         Top             =   1530
         Width           =   795
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "选择操作员"
      Height          =   2490
      Left            =   120
      TabIndex        =   4
      Top             =   120
      Width           =   1695
   End
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   1845
      Left            =   5760
      ScaleHeight     =   123
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   92
      TabIndex        =   3
      Top             =   4680
      Visible         =   0   'False
      Width           =   1380
   End
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   330
      Left            =   5640
      TabIndex        =   2
      Top             =   2640
      Width           =   850
   End
   Begin VB.CommandButton Command3 
      Caption         =   "保存"
      Height          =   330
      Left            =   4800
      TabIndex        =   1
      Top             =   2640
      Width           =   850
   End
   Begin VB.CommandButton Command2 
      Caption         =   "添加"
      Height          =   330
      Left            =   3240
      TabIndex        =   0
      Top             =   2640
      Width           =   735
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   3795
      Left            =   120
      TabIndex        =   18
      Top             =   3240
      Width           =   5970
      _ExtentX        =   10530
      _ExtentY        =   6694
      View            =   3
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      SmallIcons      =   "ImageList1"
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   1
      NumItems        =   2
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "姓名"
         Object.Width           =   5186
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "单位"
         Object.Width           =   2540
      EndProperty
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   1560
      Top             =   2640
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   48
      ImageHeight     =   48
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form1.frx":09DE
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form1.frx":2C2B
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form1.frx":159D2
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Label Label6 
      Height          =   255
      Left            =   120
      TabIndex        =   21
      Top             =   2760
      Width           =   2055
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
'Private Declare Function CopyImage Lib "user32" (ByVal handle As Long, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function SetBrushOrgEx Lib "gdi32" (ByVal hdc As Long, ByVal nXOrg As Long, ByVal nYOrg As Long, lppt As POINTAPI) As Long
Private Declare Function SetStretchBltMode Lib "gdi32" (ByVal hdc As Long, ByVal nStretchMode As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Private Const HALFTONE = 4
Public mstrPhotoFilename As String
Dim mst As New ADODB.Stream
Private Type POINTAPI
        x As Long
        y As Long
End Type
Dim Chunk() As Byte
Const ChunkSize As Long = 2384
Dim DataFile As Long
Dim Chunks As Long
Dim Fragment As Long
Dim MediaTemp As String
Dim lngOffset, lngTotalSize As Long
 Dim rs As New ADODB.Recordset
 Dim adoConnection As New ADODB.Connection


Private Sub Command5_Click()
    Command1.Enabled = False
    Command2.Enabled = True
    Command3.Enabled = False
    Command5.Enabled = False
End Sub

Private Sub Command6_Click()
    Dim i&
    添加修改 = False
    Command1.Enabled = True
    Command2.Enabled = False
    Command3.Enabled = True
     Command5.Enabled = True
    For i = 0 To Text1.UBound
      Text1(i).Enabled = True
    Next
    Text1(0).SetFocus
End Sub



Private Sub Command7_Click()
Del2DB
End Sub

Private Sub Form_Load()
Call 刷新列表2
End Sub


Public Sub 刷新列表2()
 Dim Picbyte() As Byte
 Dim FileLen  As Long
 Dim Chunks  As Long
 Dim i As Long
 Dim j As Long
 Dim mItem As ListItem
 
 

⌨️ 快捷键说明

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