home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Fast_Mask_69814472002.psc / frmMain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-04-07  |  13.2 KB  |  428 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmMain 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   7830
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   9480
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   522
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   632
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin VB.Frame Frame1 
  15.       Height          =   3735
  16.       Left            =   7920
  17.       TabIndex        =   11
  18.       Top             =   2160
  19.       Width           =   1575
  20.       Begin VB.VScrollBar scrllYScan 
  21.          Height          =   855
  22.          LargeChange     =   5
  23.          Left            =   1200
  24.          Max             =   20
  25.          Min             =   1
  26.          TabIndex        =   22
  27.          Top             =   240
  28.          Value           =   2
  29.          Width           =   255
  30.       End
  31.       Begin VB.HScrollBar scrllXScan 
  32.          Height          =   255
  33.          LargeChange     =   5
  34.          Left            =   120
  35.          Max             =   20
  36.          Min             =   1
  37.          TabIndex        =   21
  38.          Top             =   840
  39.          Value           =   5
  40.          Width           =   975
  41.       End
  42.       Begin VB.HScrollBar scrllSleep 
  43.          Height          =   255
  44.          LargeChange     =   10
  45.          Left            =   120
  46.          Max             =   1000
  47.          TabIndex        =   19
  48.          Top             =   2640
  49.          Width           =   1335
  50.       End
  51.       Begin VB.Frame Frame2 
  52.          BorderStyle     =   0  'None
  53.          Height          =   615
  54.          Left            =   120
  55.          TabIndex        =   14
  56.          Top             =   2880
  57.          Width           =   1335
  58.          Begin VB.OptionButton Option1 
  59.             Caption         =   "Solid"
  60.             Height          =   195
  61.             Index           =   1
  62.             Left            =   0
  63.             TabIndex        =   16
  64.             Top             =   360
  65.             Width           =   1215
  66.          End
  67.          Begin VB.OptionButton Option1 
  68.             Caption         =   "Transparent"
  69.             Height          =   195
  70.             Index           =   0
  71.             Left            =   0
  72.             TabIndex        =   15
  73.             Top             =   120
  74.             Width           =   1215
  75.          End
  76.       End
  77.       Begin VB.CommandButton cmdFadeIn 
  78.          Caption         =   "Fade In"
  79.          Height          =   255
  80.          Left            =   120
  81.          TabIndex        =   13
  82.          Top             =   240
  83.          Width           =   975
  84.       End
  85.       Begin VB.CommandButton cmdFadeOut 
  86.          Caption         =   "Fade InOut"
  87.          Height          =   255
  88.          Left            =   120
  89.          TabIndex        =   12
  90.          Top             =   480
  91.          Width           =   975
  92.       End
  93.       Begin VB.Label lblYScan 
  94.          Alignment       =   2  'Center
  95.          Height          =   255
  96.          Left            =   960
  97.          TabIndex        =   25
  98.          Top             =   1200
  99.          Width           =   495
  100.       End
  101.       Begin VB.Label lblXScan 
  102.          Alignment       =   2  'Center
  103.          Height          =   255
  104.          Left            =   120
  105.          TabIndex        =   24
  106.          Top             =   1200
  107.          Width           =   495
  108.       End
  109.       Begin VB.Label Label3 
  110.          Alignment       =   2  'Center
  111.          Caption         =   "           Mask          XScan        YScan"
  112.          Height          =   495
  113.          Left            =   120
  114.          TabIndex        =   23
  115.          Top             =   1440
  116.          Width           =   1335
  117.       End
  118.       Begin VB.Label Label2 
  119.          Caption         =   "Sleep"
  120.          Height          =   255
  121.          Left            =   120
  122.          TabIndex        =   20
  123.          Top             =   2280
  124.          Width           =   495
  125.       End
  126.    End
  127.    Begin VB.PictureBox picSpriteWhtBkg 
  128.       AutoRedraw      =   -1  'True
  129.       AutoSize        =   -1  'True
  130.       BorderStyle     =   0  'None
  131.       Height          =   1935
  132.       Left            =   4200
  133.       ScaleHeight     =   129
  134.       ScaleMode       =   3  'Pixel
  135.       ScaleWidth      =   89
  136.       TabIndex        =   6
  137.       Top             =   4320
  138.       Width           =   1335
  139.    End
  140.    Begin VB.PictureBox picSpriteBlkBkg 
  141.       AutoRedraw      =   -1  'True
  142.       AutoSize        =   -1  'True
  143.       BorderStyle     =   0  'None
  144.       Height          =   1935
  145.       Left            =   240
  146.       ScaleHeight     =   129
  147.       ScaleMode       =   3  'Pixel
  148.       ScaleWidth      =   89
  149.       TabIndex        =   5
  150.       Top             =   4320
  151.       Width           =   1335
  152.    End
  153.    Begin VB.PictureBox picToFadeIn 
  154.       AutoSize        =   -1  'True
  155.       BorderStyle     =   0  'None
  156.       Height          =   2790
  157.       Left            =   4080
  158.       Picture         =   "frmMain.frx":0000
  159.       ScaleHeight     =   186
  160.       ScaleMode       =   3  'Pixel
  161.       ScaleWidth      =   195
  162.       TabIndex        =   4
  163.       Top             =   480
  164.       Width           =   2925
  165.    End
  166.    Begin VB.PictureBox picHidden1 
  167.       AutoRedraw      =   -1  'True
  168.       AutoSize        =   -1  'True
  169.       BorderStyle     =   0  'None
  170.       Height          =   495
  171.       Left            =   10080
  172.       ScaleHeight     =   33
  173.       ScaleMode       =   3  'Pixel
  174.       ScaleWidth      =   33
  175.       TabIndex        =   3
  176.       Top             =   2760
  177.       Visible         =   0   'False
  178.       Width           =   495
  179.    End
  180.    Begin MSComDlg.CommonDialog CommonDialog1 
  181.       Left            =   360
  182.       Top             =   8520
  183.       _ExtentX        =   847
  184.       _ExtentY        =   847
  185.       _Version        =   393216
  186.    End
  187.    Begin VB.PictureBox picMask 
  188.       Height          =   360
  189.       Left            =   7920
  190.       Picture         =   "frmMain.frx":55A1
  191.       ScaleHeight     =   20
  192.       ScaleMode       =   3  'Pixel
  193.       ScaleWidth      =   20
  194.       TabIndex        =   2
  195.       Top             =   840
  196.       Width           =   360
  197.    End
  198.    Begin VB.PictureBox picEdit 
  199.       BorderStyle     =   0  'None
  200.       Height          =   495
  201.       Left            =   10080
  202.       ScaleHeight     =   33
  203.       ScaleMode       =   3  'Pixel
  204.       ScaleWidth      =   33
  205.       TabIndex        =   1
  206.       Top             =   3480
  207.       Visible         =   0   'False
  208.       Width           =   495
  209.    End
  210.    Begin VB.PictureBox picMain 
  211.       AutoSize        =   -1  'True
  212.       BorderStyle     =   0  'None
  213.       Height          =   3360
  214.       Left            =   120
  215.       Picture         =   "frmMain.frx":563B
  216.       ScaleHeight     =   224
  217.       ScaleMode       =   3  'Pixel
  218.       ScaleWidth      =   250
  219.       TabIndex        =   0
  220.       Top             =   480
  221.       Width           =   3750
  222.    End
  223.    Begin VB.Label Label1 
  224.       Caption         =   "(click for new mask)"
  225.       Height          =   255
  226.       Index           =   5
  227.       Left            =   7920
  228.       TabIndex        =   18
  229.       Top             =   360
  230.       Width           =   1455
  231.    End
  232.    Begin VB.Label Label1 
  233.       Caption         =   "Mask Black/White"
  234.       Height          =   255
  235.       Index           =   4
  236.       Left            =   7920
  237.       TabIndex        =   17
  238.       Top             =   120
  239.       Width           =   1575
  240.    End
  241.    Begin VB.Label Label1 
  242.       Caption         =   "Sprite ""And"""
  243.       Height          =   255
  244.       Index           =   3
  245.       Left            =   4200
  246.       TabIndex        =   10
  247.       Top             =   3960
  248.       Width           =   1095
  249.    End
  250.    Begin VB.Label Label1 
  251.       Caption         =   "Sprite ""OR"""
  252.       Height          =   255
  253.       Index           =   2
  254.       Left            =   240
  255.       TabIndex        =   9
  256.       Top             =   3960
  257.       Width           =   1095
  258.    End
  259.    Begin VB.Label Label1 
  260.       Caption         =   "Sprite (click to load new sprite)"
  261.       Height          =   255
  262.       Index           =   1
  263.       Left            =   4200
  264.       TabIndex        =   8
  265.       Top             =   120
  266.       Width           =   2655
  267.    End
  268.    Begin VB.Label Label1 
  269.       Caption         =   "Main Screen (click to load new picture)"
  270.       Height          =   255
  271.       Index           =   0
  272.       Left            =   240
  273.       TabIndex        =   7
  274.       Top             =   120
  275.       Width           =   3015
  276.    End
  277. Attribute VB_Name = "frmMain"
  278. Attribute VB_GlobalNameSpace = False
  279. Attribute VB_Creatable = False
  280. Attribute VB_PredeclaredId = True
  281. Attribute VB_Exposed = False
  282. Option Explicit
  283. Private Sub Form_Load()
  284. rtnInitialize
  285. End Sub
  286. Private Sub rtnInitialize()
  287. intMaxPicSize = 250 'Height and Width
  288. intPlaceX = 0: intPlaceY = 0 'Sprite placement
  289. 'Mask scan Scrollbar Values
  290. lblXScan = scrllXScan.Value
  291. lblYScan = scrllYScan.Value
  292. intScanX = scrllXScan.Value
  293. intScanY = scrllYScan.Value
  294. Option1(0).Value = True 'Select transparency
  295. booReDraw = True 'Whether or not to redraw sprites (avoid redundancy)
  296. frmMain.Show
  297. frmMain.Refresh
  298. frmMain.ScaleMode = 3
  299. picMain.ScaleMode = 3
  300. picMain.AutoRedraw = True
  301. picMain.AutoSize = True
  302. picMain.BackColor = vbWhite
  303. If picMain.Width > 300 Then picMain.Width = 300
  304. If picMain.Height > 300 Then picMain.Height = 300
  305. picMain.Picture = picMain.Image
  306. Set pixMainPicture = picMain.Picture
  307. Set pixMainPictureWithSprite = picMain.Picture 'In case of FadeInOut click
  308. picEdit.ScaleMode = 3
  309. picEdit.AutoRedraw = True
  310. picEdit.AutoSize = True
  311. picEdit.BackColor = vbWhite
  312. picEdit.Picture = picEdit.Image
  313. picMask.Picture = picMask.Image
  314. End Sub
  315. Private Sub cmdFadeIn_Click()
  316. If Option1(0).Value = True And booReDraw = True Then rtnShowPictureDraw
  317. rtnFadeIn
  318. booReDraw = False
  319. End Sub
  320. Private Sub cmdFadeOut_Click()
  321. If Option1(0).Value = True And booReDraw = True Then rtnShowPictureDraw
  322. rtnFadeIn
  323. rtnFadeOut
  324. booReDraw = False
  325. End Sub
  326. Private Sub picMain_Click()
  327. 'Get New Main Screen Picture
  328. rtnCommonDialog
  329. If stFilename = "" Then Exit Sub
  330. booReDraw = True 'Redraw sprites
  331. picMain.Picture = LoadPicture(stFilename)
  332. If picMain.Width > intMaxPicSize Then picMain.Width = intMaxPicSize
  333. If picMain.Height > intMaxPicSize Then picMain.Height = intMaxPicSize
  334. If picToFadeIn.Width > picMain.Width Then picToFadeIn.Width = picMain.Width
  335. If picToFadeIn.Height > picMain.Height Then picToFadeIn.Height = picMain.Height
  336. picMain.Picture = picMain.Image
  337. Set pixMainPicture = picMain.Picture
  338. picToFadeIn.Picture = picToFadeIn.Image
  339. End Sub
  340. Private Sub picToFadeIn_Click()
  341. 'Get New Sprite
  342. rtnCommonDialog
  343. If stFilename = "" Then Exit Sub
  344. booReDraw = True 'Redraw sprites
  345. picToFadeIn.Picture = LoadPicture(stFilename)
  346. If picToFadeIn.Width > picMain.Width Then picToFadeIn.Width = picMain.Width
  347. If picToFadeIn.Height > picMain.Height Then picToFadeIn.Height = picMain.Height
  348. picToFadeIn.Picture = picToFadeIn.Image
  349. End Sub
  350. Private Sub picMask_Click()
  351. 'Get New Mask
  352. Dim stTemp As String
  353. rtnCommonDialog
  354. If stFilename = "" Then Exit Sub
  355. picMask.Picture = LoadPicture(stFilename)
  356. picMask.Picture = picMask.Image
  357. stTemp = Right(stFilename, 10) 'mask**.***
  358. stTemp = Mid(stTemp, 5, 2)
  359. 'Select X,Y default scan values per each mask to avoid user confusion
  360. Select Case stTemp
  361.     Case "01"
  362.     scrllXScan.Value = 5
  363.     scrllYScan.Value = 2
  364.     Case "02"
  365.     scrllXScan.Value = 8
  366.     scrllYScan.Value = 8
  367.     Case "03"
  368.     scrllXScan.Value = 6
  369.     scrllYScan.Value = 7
  370.     Case "04"
  371.     scrllXScan.Value = 14
  372.     scrllYScan.Value = 1
  373.     Case "05"
  374.     scrllXScan.Value = 18
  375.     scrllYScan.Value = 1
  376.     Case "06"
  377.     scrllXScan.Value = 10
  378.     scrllYScan.Value = 1
  379.     Case "07"
  380.     scrllXScan.Value = 10
  381.     scrllYScan.Value = 1
  382.     Case "08"
  383.     scrllXScan.Value = 11
  384.     scrllYScan.Value = 1
  385.     Case "10"
  386.     scrllXScan.Value = 6
  387.     scrllYScan.Value = 7
  388.     Case "11"
  389.     scrllXScan.Value = 12
  390.     scrllYScan.Value = 1
  391.     Case "12"
  392.     scrllXScan.Value = 20
  393.     scrllYScan.Value = 1
  394.     Case "13"
  395.     scrllXScan.Value = 10
  396.     scrllYScan.Value = 1
  397.     Case "14"
  398.     scrllXScan.Value = 6
  399.     scrllYScan.Value = 1
  400. End Select
  401. End Sub
  402. Private Sub rtnCommonDialog()
  403. 'Common Dialog Window
  404. CommonDialog1.CancelError = True  'Enable on error or cancel GoTo
  405. On Error GoTo cancelPressed
  406. CommonDialog1.Flags = cdlOFNHideReadOnly  'disable read only chk box
  407. CommonDialog1.DialogTitle = "Open Main Picture"        'Title displayed
  408. CommonDialog1.InitDir = ""                'Start Directory
  409.        
  410. 'Format     object.Filter [= description1 |filter1 |description2 |filter2...]
  411. 'Example    Text (*.txt)|*.txt|Pictures (*.bmp;*.ico)|*.bmp;*.ico
  412. CommonDialog1.Filter = "Pictures (*.bmp;*.jpg;*.gif)|*.bmp;*.jpg;*.gif|(All Files)|*.*"
  413. CommonDialog1.FileName = ""
  414. CommonDialog1.ShowOpen
  415. stFilename = CommonDialog1.FileName
  416. Exit Sub
  417. cancelPressed:
  418. stFilename = CommonDialog1.FileName
  419. End Sub
  420. Private Sub scrllXScan_Change()
  421. lblXScan = scrllXScan.Value
  422. intScanX = scrllXScan.Value
  423. End Sub
  424. Private Sub scrllYScan_Change()
  425. lblYScan = scrllYScan.Value
  426. intScanY = scrllYScan.Value
  427. End Sub
  428.