home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / Src / Ch9 / Scenes.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-05-29  |  11.7 KB  |  349 lines

  1. VERSION 5.00
  2. Begin VB.Form frmScenes 
  3.    Caption         =   "Scenes"
  4.    ClientHeight    =   4590
  5.    ClientLeft      =   1635
  6.    ClientTop       =   945
  7.    ClientWidth     =   6150
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   4590
  11.    ScaleWidth      =   6150
  12.    Begin VB.CommandButton cmdRandom 
  13.       Height          =   255
  14.       Left            =   120
  15.       Picture         =   "Scenes.frx":0000
  16.       Style           =   1  'Graphical
  17.       TabIndex        =   20
  18.       TabStop         =   0   'False
  19.       Top             =   2040
  20.       Width           =   255
  21.    End
  22.    Begin VB.CommandButton cmdSpiralOut 
  23.       Height          =   255
  24.       Left            =   720
  25.       Picture         =   "Scenes.frx":00FA
  26.       Style           =   1  'Graphical
  27.       TabIndex        =   19
  28.       TabStop         =   0   'False
  29.       Top             =   2040
  30.       Width           =   255
  31.    End
  32.    Begin VB.CommandButton cmdSpiralIn 
  33.       Height          =   255
  34.       Left            =   420
  35.       Picture         =   "Scenes.frx":01F4
  36.       Style           =   1  'Graphical
  37.       TabIndex        =   18
  38.       TabStop         =   0   'False
  39.       Top             =   2040
  40.       Width           =   255
  41.    End
  42.    Begin VB.PictureBox picCanvas 
  43.       AutoRedraw      =   -1  'True
  44.       Height          =   3885
  45.       Left            =   1200
  46.       Picture         =   "Scenes.frx":02EE
  47.       ScaleHeight     =   255
  48.       ScaleMode       =   3  'Pixel
  49.       ScaleWidth      =   300
  50.       TabIndex        =   2
  51.       Top             =   120
  52.       Width           =   4560
  53.    End
  54.    Begin VB.PictureBox picBlank 
  55.       AutoRedraw      =   -1  'True
  56.       AutoSize        =   -1  'True
  57.       Height          =   480
  58.       Left            =   840
  59.       ScaleHeight     =   28
  60.       ScaleMode       =   3  'Pixel
  61.       ScaleWidth      =   29
  62.       TabIndex        =   17
  63.       Top             =   3240
  64.       Visible         =   0   'False
  65.       Width           =   495
  66.    End
  67.    Begin VB.CommandButton cmdRightLeft 
  68.       Height          =   255
  69.       Left            =   420
  70.       Picture         =   "Scenes.frx":383AC
  71.       Style           =   1  'Graphical
  72.       TabIndex        =   16
  73.       TabStop         =   0   'False
  74.       Top             =   2400
  75.       Width           =   255
  76.    End
  77.    Begin VB.CommandButton cmdSlide 
  78.       Height          =   255
  79.       Index           =   0
  80.       Left            =   420
  81.       Picture         =   "Scenes.frx":384A6
  82.       Style           =   1  'Graphical
  83.       TabIndex        =   15
  84.       TabStop         =   0   'False
  85.       Top             =   1080
  86.       Width           =   255
  87.    End
  88.    Begin VB.CommandButton cmdSlide 
  89.       Height          =   255
  90.       Index           =   1
  91.       Left            =   120
  92.       Picture         =   "Scenes.frx":385A0
  93.       Style           =   1  'Graphical
  94.       TabIndex        =   14
  95.       TabStop         =   0   'False
  96.       Top             =   1380
  97.       Width           =   255
  98.    End
  99.    Begin VB.CommandButton cmdSlide 
  100.       Height          =   255
  101.       Index           =   2
  102.       Left            =   720
  103.       Picture         =   "Scenes.frx":3869A
  104.       Style           =   1  'Graphical
  105.       TabIndex        =   13
  106.       TabStop         =   0   'False
  107.       Top             =   1380
  108.       Width           =   255
  109.    End
  110.    Begin VB.CommandButton cmdSlide 
  111.       Height          =   255
  112.       Index           =   3
  113.       Left            =   420
  114.       Picture         =   "Scenes.frx":38794
  115.       Style           =   1  'Graphical
  116.       TabIndex        =   12
  117.       TabStop         =   0   'False
  118.       Top             =   1680
  119.       Width           =   255
  120.    End
  121.    Begin VB.CommandButton cmdWipe 
  122.       Height          =   255
  123.       Index           =   8
  124.       Left            =   720
  125.       Picture         =   "Scenes.frx":3888E
  126.       Style           =   1  'Graphical
  127.       TabIndex        =   11
  128.       TabStop         =   0   'False
  129.       Top             =   720
  130.       Width           =   255
  131.    End
  132.    Begin VB.CommandButton cmdWipe 
  133.       Height          =   255
  134.       Index           =   7
  135.       Left            =   420
  136.       Picture         =   "Scenes.frx":38988
  137.       Style           =   1  'Graphical
  138.       TabIndex        =   10
  139.       TabStop         =   0   'False
  140.       Top             =   720
  141.       Width           =   255
  142.    End
  143.    Begin VB.CommandButton cmdWipe 
  144.       Height          =   255
  145.       Index           =   6
  146.       Left            =   120
  147.       Picture         =   "Scenes.frx":38A82
  148.       Style           =   1  'Graphical
  149.       TabIndex        =   9
  150.       TabStop         =   0   'False
  151.       Top             =   720
  152.       Width           =   255
  153.    End
  154.    Begin VB.CommandButton cmdWipe 
  155.       Height          =   255
  156.       Index           =   5
  157.       Left            =   720
  158.       Picture         =   "Scenes.frx":38B7C
  159.       Style           =   1  'Graphical
  160.       TabIndex        =   8
  161.       TabStop         =   0   'False
  162.       Top             =   420
  163.       Width           =   255
  164.    End
  165.    Begin VB.CommandButton cmdWipe 
  166.       Height          =   255
  167.       Index           =   4
  168.       Left            =   420
  169.       Picture         =   "Scenes.frx":38C76
  170.       Style           =   1  'Graphical
  171.       TabIndex        =   7
  172.       TabStop         =   0   'False
  173.       Top             =   420
  174.       Width           =   255
  175.    End
  176.    Begin VB.CommandButton cmdWipe 
  177.       Height          =   255
  178.       Index           =   3
  179.       Left            =   120
  180.       Picture         =   "Scenes.frx":38D70
  181.       Style           =   1  'Graphical
  182.       TabIndex        =   6
  183.       TabStop         =   0   'False
  184.       Top             =   420
  185.       Width           =   255
  186.    End
  187.    Begin VB.CommandButton cmdWipe 
  188.       Height          =   255
  189.       Index           =   2
  190.       Left            =   720
  191.       Picture         =   "Scenes.frx":38E6A
  192.       Style           =   1  'Graphical
  193.       TabIndex        =   5
  194.       TabStop         =   0   'False
  195.       Top             =   120
  196.       Width           =   255
  197.    End
  198.    Begin VB.CommandButton cmdWipe 
  199.       Height          =   255
  200.       Index           =   1
  201.       Left            =   420
  202.       Picture         =   "Scenes.frx":38F64
  203.       Style           =   1  'Graphical
  204.       TabIndex        =   4
  205.       TabStop         =   0   'False
  206.       Top             =   120
  207.       Width           =   255
  208.    End
  209.    Begin VB.CommandButton cmdWipe 
  210.       Height          =   255
  211.       Index           =   0
  212.       Left            =   120
  213.       Picture         =   "Scenes.frx":3905E
  214.       Style           =   1  'Graphical
  215.       TabIndex        =   3
  216.       TabStop         =   0   'False
  217.       Top             =   120
  218.       Width           =   255
  219.    End
  220.    Begin VB.PictureBox picHidden 
  221.       AutoRedraw      =   -1  'True
  222.       AutoSize        =   -1  'True
  223.       Height          =   4560
  224.       Index           =   1
  225.       Left            =   480
  226.       Picture         =   "Scenes.frx":39158
  227.       ScaleHeight     =   300
  228.       ScaleMode       =   3  'Pixel
  229.       ScaleWidth      =   213
  230.       TabIndex        =   1
  231.       Top             =   3480
  232.       Visible         =   0   'False
  233.       Width           =   3255
  234.    End
  235.    Begin VB.PictureBox picHidden 
  236.       AutoRedraw      =   -1  'True
  237.       AutoSize        =   -1  'True
  238.       Height          =   3885
  239.       Index           =   0
  240.       Left            =   240
  241.       Picture         =   "Scenes.frx":67F9A
  242.       ScaleHeight     =   255
  243.       ScaleMode       =   3  'Pixel
  244.       ScaleWidth      =   300
  245.       TabIndex        =   0
  246.       Top             =   3840
  247.       Visible         =   0   'False
  248.       Width           =   4560
  249.    End
  250. Attribute VB_Name = "frmScenes"
  251. Attribute VB_GlobalNameSpace = False
  252. Attribute VB_Creatable = False
  253. Attribute VB_PredeclaredId = True
  254. Attribute VB_Exposed = False
  255. Option Explicit
  256. Private Const pixels_per_frame = 10
  257. Private Const ms_per_frame = 25
  258. Private ActiveImage As Integer
  259. Private Sub cmdRandom_Click()
  260.     picCanvas.SetFocus
  261.     ActiveImage = 1 - ActiveImage
  262.     TileRandom picHidden(ActiveImage), picCanvas, ms_per_frame, 7
  263. End Sub
  264. Private Sub cmdRightLeft_Click()
  265.     picCanvas.SetFocus
  266.     ActiveImage = 1 - ActiveImage
  267.     PushLeftToRight picBlank, picCanvas, ms_per_frame, pixels_per_frame * 2
  268.     PushRightToLeft picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame * 2
  269. End Sub
  270. Private Sub cmdSpiralIn_Click()
  271.     picCanvas.SetFocus
  272.     ActiveImage = 1 - ActiveImage
  273.     TileSpiralIn picHidden(ActiveImage), picCanvas, ms_per_frame, 7
  274. End Sub
  275. Private Sub cmdSpiralOut_Click()
  276.     picCanvas.SetFocus
  277.     ActiveImage = 1 - ActiveImage
  278.     TileSpiralOut picHidden(ActiveImage), picCanvas, ms_per_frame, 7
  279. End Sub
  280. Private Sub cmdWipe_Click(Index As Integer)
  281.     picCanvas.SetFocus
  282.     ActiveImage = 1 - ActiveImage
  283.     Select Case Index
  284.         Case 0
  285.             WipeLLtoUR picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  286.         Case 1
  287.             WipeBottomToTop picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  288.         Case 2
  289.             WipeLRtoUL picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  290.         Case 3
  291.             WipeRightToLeft picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  292.         Case 4
  293.             WipeCenterOut picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  294.         Case 5
  295.             WipeLeftToRight picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  296.         Case 6
  297.             WipeURtoLL picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  298.         Case 7
  299.             WipeTopToBottom picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  300.         Case 8
  301.             WipeULtoLR picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  302.     End Select
  303. End Sub
  304. Private Sub cmdSlide_Click(Index As Integer)
  305.     picCanvas.SetFocus
  306.     ActiveImage = 1 - ActiveImage
  307.     Select Case Index
  308.         Case 0
  309.             PushBottomToTop picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  310.         Case 1
  311.             PushRightToLeft picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  312.         Case 2
  313.             PushLeftToRight picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  314.         Case 3
  315.             PushTopToBottom picHidden(ActiveImage), picCanvas, ms_per_frame, pixels_per_frame
  316.     End Select
  317. End Sub
  318. Private Sub Form_Load()
  319.     Randomize
  320.     picCanvas.AutoSize = False
  321.     picHidden(0).AutoSize = False
  322.     picHidden(1).AutoSize = False
  323.     picBlank.AutoSize = False
  324.     ' Make the pictures the same size.
  325.     If picHidden(0).Width > picHidden(1).Width Then
  326.         picCanvas.Width = picHidden(0).Width
  327.         picBlank.Width = picHidden(0).Width
  328.         picHidden(1).Width = picHidden(0).Width
  329.     Else
  330.         picCanvas.Width = picHidden(1).Width
  331.         picBlank.Width = picHidden(1).Width
  332.         picHidden(0).Width = picHidden(1).Width
  333.     End If
  334.     If picHidden(0).Height > picHidden(1).Height Then
  335.         picCanvas.Height = picHidden(0).Height
  336.         picBlank.Height = picHidden(0).Height
  337.         picHidden(1).Height = picHidden(0).Height
  338.     Else
  339.         picCanvas.Height = picHidden(1).Height
  340.         picBlank.Height = picHidden(1).Height
  341.         picHidden(0).Height = picHidden(1).Height
  342.     End If
  343.     Width = picCanvas.Left + picCanvas.Width + 120 + Width - ScaleWidth
  344.     Height = picCanvas.Top + picCanvas.Height + 120 + Height - ScaleHeight
  345. End Sub
  346. Private Sub Form_Unload(Cancel As Integer)
  347.     End
  348. End Sub
  349.