home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Samples / VBTRANS / VBTRANS.ZIP / TRANSP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-08-17  |  3.7 KB  |  113 lines

  1. VERSION 2.00
  2. Begin Form wndEarth 
  3.    Caption         =   "Take a trip in a 747 to see the world"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   7365
  8.    Height          =   4425
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    Picture         =   TRANSP.FRX:0000
  12.    ScaleHeight     =   268
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   491
  15.    Top             =   1140
  16.    Width           =   7485
  17.    Begin PictureBox picAngel 
  18.       AutoSize        =   -1  'True
  19.       Height          =   3750
  20.       Left            =   1080
  21.       Picture         =   TRANSP.FRX:165BA
  22.       ScaleHeight     =   3720
  23.       ScaleWidth      =   1785
  24.       TabIndex        =   3
  25.       Top             =   3000
  26.       Visible         =   0   'False
  27.       Width           =   1815
  28.    End
  29.    Begin CommandButton cmdTrip 
  30.       BackColor       =   &H00000000&
  31.       Caption         =   "Go!"
  32.       Height          =   375
  33.       Left            =   120
  34.       TabIndex        =   2
  35.       Top             =   120
  36.       Width           =   495
  37.    End
  38.    Begin PictureBox picPlane 
  39.       AutoSize        =   -1  'True
  40.       ClipControls    =   0   'False
  41.       Height          =   1020
  42.       Index           =   2
  43.       Left            =   240
  44.       Picture         =   TRANSP.FRX:1A054
  45.       ScaleHeight     =   66
  46.       ScaleMode       =   3  'Pixel
  47.       ScaleWidth      =   149
  48.       TabIndex        =   1
  49.       Top             =   960
  50.       Visible         =   0   'False
  51.       Width           =   2265
  52.    End
  53.    Begin PictureBox picPlane 
  54.       AutoSize        =   -1  'True
  55.       ClipControls    =   0   'False
  56.       Height          =   1020
  57.       Index           =   1
  58.       Left            =   120
  59.       Picture         =   TRANSP.FRX:1B466
  60.       ScaleHeight     =   66
  61.       ScaleMode       =   3  'Pixel
  62.       ScaleWidth      =   149
  63.       TabIndex        =   0
  64.       Top             =   720
  65.       Visible         =   0   'False
  66.       Width           =   2265
  67.    End
  68. Option Explicit
  69. Sub cmdTrip_Click ()
  70. Dim iLeft As Integer
  71. Dim iTop As Integer
  72.     Screen.MousePointer = 11
  73.     ' Make sure the picture-property contains a valid
  74.     ' bitmap-handle
  75.     picPlane(1).Picture = picPlane(1).Image
  76.     picPlane(2).Picture = picPlane(2).Image
  77.     picAngel.Picture = picAngel.Image
  78.     ' Show persisent picture of angel in upper right corner
  79.     ' This will definitively change the bitmap, so if you like
  80.     ' to keep the original bitmap intact, keep a copy of it in
  81.     ' a picture-box
  82.     ' Persistent pictures require AutoRedraw=TRUE
  83.     wndEarth.AutoRedraw = -1
  84.     LoadTransparantBitmap wndEarth.hDC, picAngel.Picture, 7, 72, 200
  85.     wndEarth.AutoRedraw = 0
  86.     ' Show the changed picture
  87.     wndEarth.Refresh
  88.     ' Set bitmap of Image property a bitmap-handle
  89.     wndEarth.Picture = wndEarth.Image
  90.     iLeft = wndEarth.ScaleWidth
  91.     iTop = 50
  92.     Do While iTop < 450
  93.         'Fly plane left
  94.         Do While iLeft > -picPlane(1).ScaleWidth
  95.             MoveTransparantBitmap wndEarth.hDC, wndEarth.Picture, 0, 0, picPlane(1).Picture, 7, iLeft + 5, iTop, iLeft, iTop
  96.             iLeft = iLeft - 5
  97.         Loop
  98.         'Fly plane right
  99.         Do While iLeft < wndEarth.ScaleWidth
  100.             MoveTransparantBitmap wndEarth.hDC, wndEarth.Picture, 0, 0, picPlane(2).Picture, 7, iLeft - 5, iTop + 100, iLeft, iTop + 100
  101.             iLeft = iLeft + 5
  102.         Loop
  103.         iTop = iTop + 200
  104.     Loop
  105.     ' Remove all non-persistent drawings with Load- or MoveTransparantBitmap function
  106.     ' The persistent graphics will stay on the screen
  107.     wndEarth.Refresh
  108.     Screen.MousePointer = 0
  109. End Sub
  110. Sub Form_Load ()
  111.     WindowState = 2
  112. End Sub
  113.