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

📄 form1.frm

📁 很多的vb经典源代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "PaintPicture方法应用示例"
   ClientHeight    =   3150
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8145
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   210
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   543
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "退出(&X)"
      Height          =   495
      Left            =   6360
      TabIndex        =   9
      Top             =   2520
      Width           =   1335
   End
   Begin VB.CommandButton Command3 
      Caption         =   "清除Picture3"
      Height          =   495
      Left            =   4920
      TabIndex        =   8
      Top             =   2520
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "复制Picture2部分到Picture3"
      Height          =   495
      Left            =   2040
      TabIndex        =   4
      Top             =   2520
      Width           =   1815
   End
   Begin VB.PictureBox Picture3 
      Height          =   2010
      Left            =   5400
      ScaleHeight     =   130
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   165
      TabIndex        =   3
      Top             =   120
      Width           =   2535
   End
   Begin VB.PictureBox Picture2 
      AutoRedraw      =   -1  'True
      BackColor       =   &H80000009&
      Height          =   2010
      Left            =   2160
      Picture         =   "Form1.frx":0000
      ScaleHeight     =   130
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   195
      TabIndex        =   2
      Top             =   120
      Width           =   2985
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H80000009&
      Height          =   1530
      Left            =   240
      Picture         =   "Form1.frx":2E67
      ScaleHeight     =   98
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   107
      TabIndex        =   1
      Top             =   120
      Width           =   1665
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Picture1复制到Picture2"
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   2520
      Width           =   1815
   End
   Begin VB.Label Label3 
      Caption         =   "从Picture2中复制的部分图形"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   5280
      TabIndex        =   7
      Top             =   2160
      Width           =   2760
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "目标图形(Picture2)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   2760
      TabIndex        =   6
      Top             =   2160
      Width           =   1890
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "源图形(Picture1)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   240
      TabIndex        =   5
      Top             =   2160
      Width           =   1680
   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 Sub Command1_Click()
    Dim width2, height2 As Single
    width2 = Picture1.ScaleWidth
    height2 = Picture1.ScaleHeight
    Picture2.PaintPicture LoadPicture("C:\samples\boy.gif"), 0, 0, , , 0, 0, width2, height2, vbSrcAnd
End Sub

Private Sub Command2_Click()
    Picture3.PaintPicture Picture2.Image, 0, 0, , , 0, 0, 120, 120, vbSrcCopy
End Sub

Private Sub Command3_Click()
    Set Picture3.Picture = Nothing
End Sub

Private Sub Command4_Click()
    End
End Sub

⌨️ 快捷键说明

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