home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SAMPLES / PGUIDE / OPTIMIZE / PAINTPIC.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-23  |  8.2 KB  |  274 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPaintPic 
  3.    Caption         =   "
  4.    ClientHeight    =   1845
  5.    ClientLeft      =   4845
  6.    ClientTop       =   3645
  7.    ClientWidth     =   4320
  8.    ClipControls    =   0   'False
  9.    ForeColor       =   &H80000008&
  10.    LinkTopic       =   "Form5"
  11.    LockControls    =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   1845
  14.    ScaleWidth      =   4320
  15.    Tag             =   "Apparent"
  16.    Begin VB.Timer Timer2 
  17.       Enabled         =   0   'False
  18.       Interval        =   50
  19.       Left            =   2400
  20.       Top             =   1305
  21.    End
  22.    Begin VB.CommandButton cmdAction 
  23.       Caption         =   "
  24. (&S)"
  25.       Height          =   495
  26.       Index           =   1
  27.       Left            =   3000
  28.       TabIndex        =   1
  29.       Top             =   1245
  30.       Width           =   1215
  31.    End
  32.    Begin VB.Timer Timer1 
  33.       Enabled         =   0   'False
  34.       Interval        =   500
  35.       Left            =   1560
  36.       Top             =   1305
  37.    End
  38.    Begin VB.PictureBox picMoon 
  39.       Appearance      =   0  'Flat
  40.       AutoSize        =   -1  'True
  41.       BackColor       =   &H80000005&
  42.       BeginProperty Font 
  43.          Name            =   "
  44.          Size            =   9
  45.          Charset         =   134
  46.          Weight          =   700
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       ForeColor       =   &H80000008&
  52.       Height          =   510
  53.       Index           =   5
  54.       Left            =   435
  55.       Picture         =   "PaintPic.frx":0000
  56.       ScaleHeight     =   480
  57.       ScaleWidth      =   480
  58.       TabIndex        =   7
  59.       Top             =   480
  60.       Visible         =   0   'False
  61.       Width           =   510
  62.    End
  63.    Begin VB.PictureBox picMoon 
  64.       Appearance      =   0  'Flat
  65.       AutoSize        =   -1  'True
  66.       BackColor       =   &H80000005&
  67.       BeginProperty Font 
  68.          Name            =   "
  69.          Size            =   9
  70.          Charset         =   134
  71.          Weight          =   700
  72.          Underline       =   0   'False
  73.          Italic          =   0   'False
  74.          Strikethrough   =   0   'False
  75.       EndProperty
  76.       ForeColor       =   &H80000008&
  77.       Height          =   510
  78.       Index           =   4
  79.       Left            =   375
  80.       Picture         =   "PaintPic.frx":0442
  81.       ScaleHeight     =   480
  82.       ScaleWidth      =   480
  83.       TabIndex        =   6
  84.       Top             =   405
  85.       Visible         =   0   'False
  86.       Width           =   510
  87.    End
  88.    Begin VB.PictureBox picMoon 
  89.       Appearance      =   0  'Flat
  90.       AutoSize        =   -1  'True
  91.       BackColor       =   &H80000005&
  92.       BeginProperty Font 
  93.          Name            =   "
  94.          Size            =   9
  95.          Charset         =   134
  96.          Weight          =   700
  97.          Underline       =   0   'False
  98.          Italic          =   0   'False
  99.          Strikethrough   =   0   'False
  100.       EndProperty
  101.       ForeColor       =   &H80000008&
  102.       Height          =   510
  103.       Index           =   3
  104.       Left            =   300
  105.       Picture         =   "PaintPic.frx":0884
  106.       ScaleHeight     =   480
  107.       ScaleWidth      =   480
  108.       TabIndex        =   5
  109.       Top             =   330
  110.       Visible         =   0   'False
  111.       Width           =   510
  112.    End
  113.    Begin VB.PictureBox picMoon 
  114.       Appearance      =   0  'Flat
  115.       AutoSize        =   -1  'True
  116.       BackColor       =   &H80000005&
  117.       BeginProperty Font 
  118.          Name            =   "
  119.          Size            =   9
  120.          Charset         =   134
  121.          Weight          =   700
  122.          Underline       =   0   'False
  123.          Italic          =   0   'False
  124.          Strikethrough   =   0   'False
  125.       EndProperty
  126.       ForeColor       =   &H80000008&
  127.       Height          =   510
  128.       Index           =   2
  129.       Left            =   225
  130.       Picture         =   "PaintPic.frx":0CC6
  131.       ScaleHeight     =   480
  132.       ScaleWidth      =   480
  133.       TabIndex        =   4
  134.       Top             =   255
  135.       Visible         =   0   'False
  136.       Width           =   510
  137.    End
  138.    Begin VB.PictureBox picMoon 
  139.       Appearance      =   0  'Flat
  140.       AutoSize        =   -1  'True
  141.       BackColor       =   &H80000005&
  142.       BeginProperty Font 
  143.          Name            =   "
  144.          Size            =   9
  145.          Charset         =   134
  146.          Weight          =   700
  147.          Underline       =   0   'False
  148.          Italic          =   0   'False
  149.          Strikethrough   =   0   'False
  150.       EndProperty
  151.       ForeColor       =   &H80000008&
  152.       Height          =   510
  153.       Index           =   1
  154.       Left            =   135
  155.       Picture         =   "PaintPic.frx":1108
  156.       ScaleHeight     =   480
  157.       ScaleWidth      =   480
  158.       TabIndex        =   3
  159.       Top             =   165
  160.       Visible         =   0   'False
  161.       Width           =   510
  162.    End
  163.    Begin VB.PictureBox picMoon 
  164.       Appearance      =   0  'Flat
  165.       AutoSize        =   -1  'True
  166.       BackColor       =   &H80000005&
  167.       BeginProperty Font 
  168.          Name            =   "
  169.          Size            =   9
  170.          Charset         =   134
  171.          Weight          =   700
  172.          Underline       =   0   'False
  173.          Italic          =   0   'False
  174.          Strikethrough   =   0   'False
  175.       EndProperty
  176.       ForeColor       =   &H80000008&
  177.       Height          =   510
  178.       Index           =   0
  179.       Left            =   60
  180.       Picture         =   "PaintPic.frx":154A
  181.       ScaleHeight     =   480
  182.       ScaleWidth      =   480
  183.       TabIndex        =   2
  184.       Top             =   90
  185.       Visible         =   0   'False
  186.       Width           =   510
  187.    End
  188.    Begin VB.CommandButton cmdAction 
  189.       Caption         =   "
  190. (&S)"
  191.       Height          =   495
  192.       Index           =   0
  193.       Left            =   60
  194.       TabIndex        =   0
  195.       Top             =   1245
  196.       Width           =   1215
  197.    End
  198.    Begin VB.Image imgMoon 
  199.       Height          =   510
  200.       Left            =   3345
  201.       Top             =   300
  202.       Width           =   510
  203.    End
  204.    Begin VB.Label Label1 
  205.       Alignment       =   2  'Center
  206.       AutoSize        =   -1  'True
  207.       BackStyle       =   0  'Transparent
  208.       Caption         =   "
  209.       Height          =   180
  210.       Index           =   1
  211.       Left            =   3240
  212.       TabIndex        =   9
  213.       Top             =   1020
  214.       Width           =   735
  215.    End
  216.    Begin VB.Label Label1 
  217.       Alignment       =   2  'Center
  218.       AutoSize        =   -1  'True
  219.       BackStyle       =   0  'Transparent
  220.       Caption         =   "
  221.       Height          =   180
  222.       Index           =   0
  223.       Left            =   300
  224.       TabIndex        =   8
  225.       Top             =   1020
  226.       Width           =   735
  227.    End
  228. Attribute VB_Name = "frmPaintPic"
  229. Attribute VB_GlobalNameSpace = False
  230. Attribute VB_Creatable = False
  231. Attribute VB_PredeclaredId = True
  232. Attribute VB_Exposed = False
  233. Option Explicit
  234. Private Sub cmdAction_Click(Index As Integer)
  235. Dim iMaxHeight As Integer, iMaxWidth As Integer
  236. Dim ipicHeight As Integer, iPicWidth As Integer
  237. Dim ipicLeft As Integer, ipicTop As Integer, i As Integer
  238. If cmdAction(Index).Caption = "
  239. (&S)" Then
  240.   If Index = 0 Then
  241.     Timer1.Interval = 20
  242.     Timer1.Enabled = True
  243.   Else
  244.     Timer2.Interval = 20
  245.     Timer2.Enabled = True
  246.   End If
  247.   cmdAction(Index).Caption = "
  248. (&S)"
  249.   If Index = 0 Then
  250.     Timer1.Enabled = False
  251.   Else
  252.     Timer2.Enabled = False
  253.   End If
  254.   cmdAction(Index).Caption = "
  255. (&S)"
  256. End If
  257. End Sub
  258. Private Sub Form_Load()
  259.   PosForm Me
  260.   Me.Show
  261. End Sub
  262. Private Sub Timer1_Timer()
  263.   Static idx As Integer
  264.   frmPaintPic.PaintPicture picMoon(idx), 400, 300
  265.   idx = idx + 1
  266.   If idx > 5 Then idx = 0
  267. End Sub
  268. Private Sub Timer2_Timer()
  269.   Static idx As Integer
  270.   imgMoon.Picture = picMoon(idx).Picture
  271.   idx = idx + 1
  272.   If idx > 5 Then idx = 0
  273. End Sub
  274.