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

📄 上下对接出图效果.frm

📁 Windows API函数,希望大伙有用哦
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3930
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5355
   LinkTopic       =   "Form1"
   ScaleHeight     =   284.736
   ScaleMode       =   0  'User
   ScaleWidth      =   363.173
   Begin VB.PictureBox Picture2 
      BorderStyle     =   0  'None
      Height          =   3945
      Left            =   0
      ScaleHeight     =   263
      ScaleMode       =   0  'User
      ScaleWidth      =   179.718
      TabIndex        =   1
      Top             =   0
      Width           =   5445
      Begin VB.Timer Timer1 
         Enabled         =   0   'False
         Interval        =   50
         Left            =   750
         Top             =   2490
      End
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BorderStyle     =   0  'None
      Height          =   3945
      Left            =   0
      Picture         =   "上下对接出图效果.frx":0000
      ScaleHeight     =   263
      ScaleMode       =   0  'User
      ScaleWidth      =   353
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   5445
   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 BitBlt Lib "gdi32" (ByVal hDestDC 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 dwRop As Long) As Long
 Dim P1 As Integer, P2 As Integer, Px As Integer, Py As Integer
 Dim A() As Integer, X() As Integer, Y() As Integer, D As Integer, I1 As Integer, I2 As Integer
Private Sub Form_Paint()
 Dim J As Integer, K As Integer, M As Integer, N As Integer
 Dim Nx As Integer, Ny As Integer, Dx As Integer
  N = 15: M = N * Picture1.ScaleHeight / Picture1.ScaleWidth
  D = M * N
'调整数组大小
  ReDim A(D) As Integer, X(D) As Integer, Y(D) As Integer
'计算图块大小
  Dx = Picture1.ScaleWidth / N
  P1 = Dx
  P2 = Dx
'按序号生成各图块坐标,以从左到右从上到下为序
     Ny = 0
      For I1 = 1 To M
        Nx = 0
       For J = 1 To N
        K = K + 1
        X(K) = Nx * Dx
        Y(K) = Ny * Dx
        Nx = Nx + 1
       Next J
       Ny = Ny + 1
      Next I1
    Picture2.Cls
    Timer1.Enabled = True
    I1 = 1: I2 = D
End Sub
Private Sub Timer1_Timer()
 If I1 > D / 2 + 1 Then
  Timer1.Enabled = False
   Else
' 根据随机数组的值,复制图块
  Px = X(I1)
  Py = Y(I1)
    BitBlt Picture2.hDC, Px, Py, P1, P2, Picture1.hDC, Px, Py, &HCC0020
  I1 = I1 + 1
  Px = X(I2)
  Py = Y(I2)
    BitBlt Picture2.hDC, Px, Py, P1, P2, Picture1.hDC, Px, Py, &HCC0020
 I2 = I2 - 1
 End If
End Sub


⌨️ 快捷键说明

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