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

📄 form1.frm

📁 vb编程+从基础到实践光盘代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "透明位图"
   ClientHeight    =   5130
   ClientLeft      =   5250
   ClientTop       =   3450
   ClientWidth     =   5775
   LinkTopic       =   "Form1"
   Picture         =   "Form1.frx":0000
   ScaleHeight     =   5130
   ScaleWidth      =   5775
   Begin VB.PictureBox smask1 
      BorderStyle     =   0  'None
      Height          =   1740
      Left            =   0
      ScaleHeight     =   116
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   384
      TabIndex        =   1
      Top             =   2520
      Visible         =   0   'False
      Width           =   5760
      Begin VB.Timer Timer1 
         Enabled         =   0   'False
         Interval        =   100
         Left            =   600
         Top             =   240
      End
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C0FFC0&
      Height          =   5175
      Left            =   0
      Picture         =   "Form1.frx":4DC5
      ScaleHeight     =   341
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   381
      TabIndex        =   0
      Top             =   0
      Width           =   5775
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private x As Integer
Private y As Integer '保存坐标

Private Sub Form_Load()
    x = 400
    y = -100
    smask1.Picture = LoadPicture(App.Path + "\22.jpg")
    Timer1.Enabled = True
End Sub

 Private Sub Timer1_Timer()
    x = x - 10  '改变图片坐标
    y = y + 8
    Picture1.Cls
    Picture1.PaintPicture smask1.Picture, x, 100, smask1.ScaleWidth, smask1.ScaleHeight, 0, 0, smask1.ScaleWidth, smask1.ScaleHeight, vbSrcPaint
    Picture1.PaintPicture smask1.Picture, -x + 150, y, smask1.ScaleWidth, smask1.ScaleHeight - x + 50, 0, 0, smask1.ScaleWidth, smask1.ScaleHeight, vbSrcPaint
  If x < -300 And y > 400 Then
        x = 400
        y = -100
    End If
End Sub

⌨️ 快捷键说明

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