home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch06 / imgcopy / imgcopy.frm (.txt) next >
Encoding:
Visual Basic Form  |  1997-02-20  |  4.1 KB  |  132 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Image Exchange through the Clipboard"
  4.    ClientHeight    =   5340
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   6510
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   2  'Custom
  10.    ScaleHeight     =   5340
  11.    ScaleWidth      =   6510
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CommandButton Command4 
  14.       Caption         =   "Draw on Image"
  15.       BeginProperty Font 
  16.          Name            =   "Tahoma"
  17.          Size            =   9.75
  18.          Charset         =   0
  19.          Weight          =   400
  20.          Underline       =   0   'False
  21.          Italic          =   0   'False
  22.          Strikethrough   =   0   'False
  23.       EndProperty
  24.       Height          =   405
  25.       Left            =   4035
  26.       TabIndex        =   5
  27.       Top             =   1635
  28.       Width           =   2310
  29.    End
  30.    Begin VB.CommandButton Command3 
  31.       Caption         =   "Load Image"
  32.       BeginProperty Font 
  33.          Name            =   "Tahoma"
  34.          Size            =   9.75
  35.          Charset         =   0
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       Height          =   405
  42.       Left            =   4035
  43.       TabIndex        =   4
  44.       Top             =   1140
  45.       Width           =   2355
  46.    End
  47.    Begin VB.CommandButton Command2 
  48.       Caption         =   "Copy From Clopboard"
  49.       BeginProperty Font 
  50.          Name            =   "Tahoma"
  51.          Size            =   9.75
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   405
  59.       Left            =   4020
  60.       TabIndex        =   3
  61.       Top             =   4770
  62.       Width           =   2355
  63.    End
  64.    Begin VB.PictureBox Picture2 
  65.       AutoRedraw      =   -1  'True
  66.       Height          =   2400
  67.       Left            =   90
  68.       ScaleHeight     =   2340
  69.       ScaleWidth      =   3675
  70.       TabIndex        =   2
  71.       Top             =   2790
  72.       Width           =   3735
  73.    End
  74.    Begin VB.CommandButton Command1 
  75.       Caption         =   "Copy To Clipboard"
  76.       BeginProperty Font 
  77.          Name            =   "Tahoma"
  78.          Size            =   9.75
  79.          Charset         =   0
  80.          Weight          =   400
  81.          Underline       =   0   'False
  82.          Italic          =   0   'False
  83.          Strikethrough   =   0   'False
  84.       EndProperty
  85.       Height          =   405
  86.       Left            =   4020
  87.       TabIndex        =   1
  88.       Top             =   2145
  89.       Width           =   2355
  90.    End
  91.    Begin VB.PictureBox Picture1 
  92.       AutoRedraw      =   -1  'True
  93.       ForeColor       =   &H00FFFFFF&
  94.       Height          =   2400
  95.       Left            =   90
  96.       ScaleHeight     =   2340
  97.       ScaleWidth      =   3675
  98.       TabIndex        =   0
  99.       Top             =   135
  100.       Width           =   3735
  101.    End
  102. Attribute VB_Name = "Form1"
  103. Attribute VB_GlobalNameSpace = False
  104. Attribute VB_Creatable = False
  105. Attribute VB_PredeclaredId = True
  106. Attribute VB_Exposed = False
  107. Private Sub Command1_Click()
  108.     Clipboard.Clear
  109.     Clipboard.SetData Picture1.Image, vbCFBitmap
  110. End Sub
  111. Private Sub Command2_Click()
  112.     If Clipboard.GetFormat(vbCFBitmap) Then
  113.         Picture2.Picture = Clipboard.GetData()
  114.     Else
  115.         MsgBox "The clipboard doesn't contain image data"
  116.     End If
  117. End Sub
  118. Private Sub Command3_Click()
  119.     Picture1.Picture = LoadPicture(App.Path + "\planets.bmp")
  120.     Form1.Refresh
  121. End Sub
  122. Private Sub Command4_Click()
  123.     Picture1.DrawWidth = 2
  124.     Picture1.Line (100, 100)-(3200, 500), , B
  125.     Picture1.DrawWidth = 1
  126.     Picture1.Circle (1000, 1500), 750
  127.     Picture1.Circle (1000, 1500), 800
  128.     Picture1.CurrentX = 200
  129.     Picture1.CurrentY = 200
  130.     Picture1.Print "Picture and Image Properties"
  131. End Sub
  132.