home *** CD-ROM | disk | FTP | other *** search
/ Apollo 18: The Moon Missions / 990125_1647.ISO / Landing / PCX / LANDING.FRM < prev    next >
Text File  |  1996-04-29  |  15KB  |  443 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "landing trial"
  4.    ClientHeight    =   5355
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1530
  7.    ClientWidth     =   4965
  8.    Height          =   5760
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5355
  12.    ScaleWidth      =   4965
  13.    Top             =   1185
  14.    Width           =   5085
  15.    Begin VB.CheckBox chkFlickerless 
  16.       Caption         =   "flickerless"
  17.       Height          =   510
  18.       Left            =   2235
  19.       TabIndex        =   10
  20.       Top             =   60
  21.       Width           =   1080
  22.    End
  23.    Begin VB.HScrollBar HScroll1 
  24.       Height          =   270
  25.       LargeChange     =   12
  26.       Left            =   795
  27.       TabIndex        =   9
  28.       Top             =   4965
  29.       Width           =   480
  30.    End
  31.    Begin VB.VScrollBar VScroll1 
  32.       Height          =   640
  33.       LargeChange     =   12
  34.       Left            =   4560
  35.       TabIndex        =   8
  36.       Top             =   810
  37.       Width           =   285
  38.    End
  39.    Begin VB.PictureBox picBackground 
  40.       BackColor       =   &H00FFFFFF&
  41.       Height          =   4110
  42.       Left            =   630
  43.       ScaleHeight     =   272
  44.       ScaleMode       =   3  'Pixel
  45.       ScaleWidth      =   245
  46.       TabIndex        =   7
  47.       Top             =   675
  48.       Width           =   3705
  49.    End
  50.    Begin VB.PictureBox picWork 
  51.       AutoSize        =   -1  'True
  52.       BackColor       =   &H00FFFFFF&
  53.       BorderStyle     =   0  'None
  54.       Height          =   360
  55.       Left            =   210
  56.       ScaleHeight     =   24
  57.       ScaleMode       =   3  'Pixel
  58.       ScaleWidth      =   21
  59.       TabIndex        =   6
  60.       Top             =   2355
  61.       Width           =   315
  62.    End
  63.    Begin VB.PictureBox picSave 
  64.       AutoRedraw      =   -1  'True
  65.       BackColor       =   &H00FFFFFF&
  66.       BorderStyle     =   0  'None
  67.       Height          =   345
  68.       Left            =   210
  69.       ScaleHeight     =   23
  70.       ScaleMode       =   3  'Pixel
  71.       ScaleWidth      =   22
  72.       TabIndex        =   5
  73.       Top             =   1785
  74.       Width           =   330
  75.    End
  76.    Begin VB.Timer Timer2 
  77.       Interval        =   55
  78.       Left            =   5145
  79.       Top             =   90
  80.    End
  81.    Begin VB.Timer Timer1 
  82.       Interval        =   55
  83.       Left            =   4605
  84.       Top             =   90
  85.    End
  86.    Begin VB.PictureBox crosshairMask 
  87.       AutoRedraw      =   -1  'True
  88.       AutoSize        =   -1  'True
  89.       BorderStyle     =   0  'None
  90.       Height          =   285
  91.       Left            =   210
  92.       Picture         =   "LANDING.frx":0000
  93.       ScaleHeight     =   19
  94.       ScaleMode       =   3  'Pixel
  95.       ScaleWidth      =   19
  96.       TabIndex        =   4
  97.       Top             =   1320
  98.       Width           =   285
  99.    End
  100.    Begin VB.PictureBox crosshair 
  101.       AutoRedraw      =   -1  'True
  102.       AutoSize        =   -1  'True
  103.       BorderStyle     =   0  'None
  104.       Height          =   285
  105.       Left            =   240
  106.       Picture         =   "LANDING.frx":01C8
  107.       ScaleHeight     =   19
  108.       ScaleMode       =   3  'Pixel
  109.       ScaleWidth      =   19
  110.       TabIndex        =   3
  111.       Top             =   855
  112.       Width           =   285
  113.    End
  114.    Begin VB.CommandButton btnGo 
  115.       Caption         =   "Move Sprite"
  116.       Height          =   435
  117.       Left            =   315
  118.       TabIndex        =   2
  119.       Top             =   135
  120.       Width           =   1215
  121.    End
  122.    Begin VB.PictureBox landsite 
  123.       AutoRedraw      =   -1  'True
  124.       AutoSize        =   -1  'True
  125.       ForeColor       =   &H0000FFFF&
  126.       Height          =   7230
  127.       Left            =   5775
  128.       Picture         =   "LANDING.frx":0394
  129.       ScaleHeight     =   7200
  130.       ScaleWidth      =   9600
  131.       TabIndex        =   1
  132.       Top             =   1035
  133.       Width           =   9630
  134.    End
  135.    Begin VB.PictureBox landcompare 
  136.       Height          =   495
  137.       Left            =   330
  138.       Picture         =   "LANDING.frx":4B7D4
  139.       ScaleHeight     =   465
  140.       ScaleWidth      =   1185
  141.       TabIndex        =   0
  142.       Top             =   6255
  143.       Width           =   1215
  144.    End
  145.    Begin VB.Label Label1 
  146.       BackStyle       =   0  'Transparent
  147.       Caption         =   "Primary Target"
  148.       ForeColor       =   &H0000FFFF&
  149.       Height          =   255
  150.       Left            =   3210
  151.       TabIndex        =   12
  152.       Top             =   4905
  153.       Width           =   1080
  154.    End
  155.    Begin VB.Label AltReadOut 
  156.       BackStyle       =   0  'Transparent
  157.       Caption         =   "10000"
  158.       ForeColor       =   &H0000FFFF&
  159.       Height          =   255
  160.       Left            =   2160
  161.       TabIndex        =   11
  162.       Top             =   4950
  163.       Width           =   600
  164.    End
  165. End
  166. Attribute VB_Name = "Form1"
  167. Attribute VB_Creatable = False
  168. Attribute VB_Exposed = False
  169. Option Explicit
  170. '--------------------------------------------
  171. ' PROJLAND.FRM
  172. ' This program is test for graphics to be used in
  173. ' landing routines.
  174. ' displaying bitmaps and sprites.
  175. ' -------------------------------------------
  176.  
  177.  
  178. ' The number of pixels to offset the sprite
  179. ' each time it is moved.
  180. Const INCREMENT = 3
  181.  
  182. ' Constants for Raster Operations used by BitBlt function.
  183. Const SRCAND = &H8800C6      ' dest = source AND dest
  184. Const SRCCOPY = &HCC0020     ' dest = source
  185. Const SRCPAINT = &HEE0086    ' dest = source OR dest
  186.  
  187. ' The BitBlt Windows API call.
  188. Private Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  189.  
  190. ' The x and y coordinates for the Sprite
  191. Dim SpriteX As Integer
  192. Dim SpriteY As Integer
  193.  
  194. ' The x and y coordinates for the upper left corner
  195. ' of the large bitmap (landSite).
  196. Dim BackgroundX As Integer
  197. Dim BackgroundY As Integer
  198.  
  199. ' The width and height of the work area bitmap (picWork).
  200. Dim WorkWidth As Integer
  201. Dim WorkHeight As Integer
  202.  
  203. Dim Hght As Integer
  204.  
  205.  
  206. Private Sub btnGo_Click()
  207.   '-----------------------------------------------------
  208. ' Start the simple sprite demonstration when this
  209. ' button is pushed.
  210. '-----------------------------------------------------
  211. Dim rc As Integer
  212.  
  213.     ' We're running.
  214.     If Timer1.Enabled Then
  215.         Timer1.Enabled = False
  216.         ' Restore BG
  217.         If chkFlickerless = 0 Then
  218.             rc = BitBlt(picBackground.hDC, SpriteX, SpriteY, picSave.ScaleWidth, picSave.ScaleHeight, picSave.hDC, 0, 0, SRCCOPY)
  219.         Else
  220.             VScroll1_Change
  221.         End If
  222.     ' We're stopped.
  223.     Else
  224.         ' Save BG
  225.         If chkFlickerless = 0 Then rc = BitBlt(picSave.hDC, 0, 0, picSave.ScaleWidth, picSave.ScaleHeight, picBackground.hDC, SpriteX, SpriteY, SRCCOPY)
  226.         Timer1.Enabled = True
  227.     End If
  228.  
  229. End Sub
  230.  
  231.  
  232. Private Sub Form_Load()
  233.   '-----------------------------------------------------
  234. '
  235. '-----------------------------------------------------
  236. Dim rc As Integer
  237.  
  238.     Me.Show
  239.  
  240.     'chkAutoRedraw.Value = 1
  241.  
  242.     ' Set the limits of the scroll bars.
  243.     HScroll1.Max = landsite.ScaleWidth - picBackground.ScaleWidth
  244.     VScroll1.Max = landsite.ScaleHeight - picBackground.ScaleHeight
  245.     
  246.     ' Only enable the scrollers if landSite is larger than
  247.     ' the picBackground bitmap.
  248.     If landsite.ScaleWidth <= picBackground.ScaleWidth Then HScroll1.Enabled = False
  249.     If landsite.ScaleHeight <= picBackground.ScaleHeight Then VScroll1.Enabled = False
  250.                               
  251.     ' Save this initial section of the background. It may be
  252.     ' needed for the flickering sprite demo.
  253.     rc = BitBlt(picBackground.hDC, 0, 0, picBackground.ScaleWidth, picBackground.ScaleHeight, landsite.hDC, HScroll1, VScroll1, SRCCOPY)
  254.     
  255.     ' Set the dimensions of the work bitmap.
  256.     WorkWidth = (crosshair.Width / 15) + (INCREMENT * 2)
  257.