当前位置: 源码素材网 » VB教程 » 详情页

VB使用SetData将图片数据放入剪贴板

  •   时间:2019-05-15
  • 概述:剪贴板

VB6.0使用SetData函数将图像数据放入剪贴板,这里要说明一下,为确保图像顺序写入剪帖板,在使用SetData前,请先用Clear方法清除剪贴板:

VERSION 5.00
Begin VB.Form Form1 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   Caption         =   "把图形放入剪贴板"
   ClientHeight    =   1245
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3480
   LinkTopic       =   "Form1"
   ScaleHeight     =   1245
   ScaleWidth      =   3480
   StartUpPosition =   3  '窗口缺省
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   540
      Left            =   720
      ScaleHeight     =   510
      ScaleWidth      =   510
      TabIndex        =   0
      Top             =   360
      Width           =   540
   End
   Begin VB.Image Image1 
      Appearance      =   0  'Flat
      Height          =   612
      Left            =   2280
      Top             =   360
      Width           =   732
   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 Form_Load()
'加载图形
    Picture1.Picture = LoadPicture(App.Path & "\Cdrom01.ico")
'用Clear方法清除剪贴板
    Clipboard.Clear
'将图形放入剪贴板
    Clipboard.SetData Picture1.Image, vbCFBitmap
End Sub

    相关声明:

      若“VB使用SetData将图片数据放入剪贴板”有损您的权益,请告之我们删除内容。
      部分文章来源于网络,版权归原作者所有。