home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch07 / imgcopy / imgcopy.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-04-13  |  4.8 KB  |  152 lines

  1. VERSION 5.00
  2. Begin VB.Form ImageCopyForm 
  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.CheckBox Check1 
  14.       Caption         =   "AutoRedraw"
  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          =   270
  25.       Left            =   4035
  26.       TabIndex        =   6
  27.       Top             =   750
  28.       Value           =   1  'Checked
  29.       Width           =   2145
  30.    End
  31.    Begin VB.CommandButton Command4 
  32.       Caption         =   "Draw on Image"
  33.       BeginProperty Font 
  34.          Name            =   "Tahoma"
  35.          Size            =   9.75
  36.          Charset         =   0
  37.          Weight          =   400
  38.          Underline       =   0   'False
  39.          Italic          =   0   'False
  40.          Strikethrough   =   0   'False
  41.       EndProperty
  42.       Height          =   405
  43.       Left            =   4035
  44.       TabIndex        =   5
  45.       Top             =   1635
  46.       Width           =   2310
  47.    End
  48.    Begin VB.CommandButton Command3 
  49.       Caption         =   "Load Image"
  50.       BeginProperty Font 
  51.          Name            =   "Tahoma"
  52.          Size            =   9.75
  53.          Charset         =   0
  54.          Weight          =   400
  55.          Underline       =   0   'False
  56.          Italic          =   0   'False
  57.          Strikethrough   =   0   'False
  58.       EndProperty
  59.       Height          =   405
  60.       Left            =   4035
  61.       TabIndex        =   4
  62.       Top             =   1140
  63.       Width           =   2355
  64.    End
  65.    Begin VB.CommandButton Command2 
  66.       Caption         =   "Copy From Clopboard"
  67.       BeginProperty Font 
  68.          Name            =   "Tahoma"
  69.          Size            =   9.75
  70.          Charset         =   0
  71.          Weight          =   400
  72.          Underline       =   0   'False
  73.          Italic          =   0   'False
  74.          Strikethrough   =   0   'False
  75.       EndProperty
  76.       Height          =   405
  77.       Left            =   4020
  78.       TabIndex        =   3
  79.       Top             =   4770
  80.       Width           =   2355
  81.    End
  82.    Begin VB.PictureBox Picture2 
  83.       AutoRedraw      =   -1  'True
  84.       Height          =   2400
  85.       Left            =   90
  86.       ScaleHeight     =   2340
  87.       ScaleWidth      =   3675
  88.       TabIndex        =   2
  89.       Top             =   2790
  90.       Width           =   3735
  91.    End
  92.    Begin VB.CommandButton Command1 
  93.       Caption         =   "Copy To Clipboard"
  94.       BeginProperty Font 
  95.          Name            =   "Tahoma"
  96.          Size            =   9.75
  97.          Charset         =   0
  98.          Weight          =   400
  99.          Underline       =   0   'False
  100.          Italic          =   0   'False
  101.          Strikethrough   =   0   'False
  102.       EndProperty
  103.       Height          =   405
  104.       Left            =   4020
  105.       TabIndex        =   1
  106.       Top             =   2145
  107.       Width           =   2355
  108.    End
  109.    Begin VB.PictureBox Picture1 
  110.       AutoRedraw      =   -1  'True
  111.       ForeColor       =   &H00FFFFFF&
  112.       Height          =   2400
  113.       Left            =   90
  114.       ScaleHeight     =   2340
  115.       ScaleWidth      =   3675
  116.       TabIndex        =   0
  117.       Top             =   150
  118.       Width           =   3735
  119.    End
  120. Attribute VB_Name = "ImageCopyForm"
  121. Attribute VB_GlobalNameSpace = False
  122. Attribute VB_Creatable = False
  123. Attribute VB_PredeclaredId = True
  124. Attribute VB_Exposed = False
  125. Private Sub Command1_Click()
  126.     Clipboard.Clear
  127.     Clipboard.SetData Picture1.Image, vbCFBitmap
  128. End Sub
  129. Private Sub Command2_Click()
  130.     If Clipboard.GetFormat(vbCFBitmap) Then
  131.         Picture2.Picture = Clipboard.GetData()
  132.     Else
  133.         MsgBox "The clipboard doesn't contain image data"
  134.     End If
  135. End Sub
  136. Private Sub Command3_Click()
  137.     Picture1.Picture = LoadPicture(App.Path + "\planets.bmp")
  138.     ImageCopyForm.Refresh
  139. End Sub
  140. Private Sub Command4_Click()
  141.     If Check1.Value = 0 Then Picture1.AutoRedraw = False
  142.     Picture1.DrawWidth = 2
  143.     Picture1.Line (100, 100)-(3200, 500), , B
  144.     Picture1.DrawWidth = 1
  145.     Picture1.Circle (1000, 1500), 750
  146.     Picture1.Circle (1000, 1500), 800
  147.     Picture1.CurrentX = 200
  148.     Picture1.CurrentY = 200
  149.     Picture1.Print "Picture and Image Properties"
  150.     Picture1.AutoRedraw = True
  151. End Sub
  152.