home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch08 / wipes / wipes.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-20  |  12.4 KB  |  372 lines

  1. VERSION 5.00
  2. Begin VB.Form WipesForm 
  3.    Caption         =   "Image Wipes"
  4.    ClientHeight    =   5985
  5.    ClientLeft      =   1770
  6.    ClientTop       =   2295
  7.    ClientWidth     =   10770
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5985
  10.    ScaleWidth      =   10770
  11.    Begin VB.CheckBox ClearDestination 
  12.       Caption         =   "Clear destination before wipe"
  13.       BeginProperty Font 
  14.          Name            =   "MS Sans Serif"
  15.          Size            =   9.75
  16.          Charset         =   0
  17.          Weight          =   400
  18.          Underline       =   0   'False
  19.          Italic          =   0   'False
  20.          Strikethrough   =   0   'False
  21.       EndProperty
  22.       Height          =   210
  23.       Left            =   5640
  24.       TabIndex        =   12
  25.       Top             =   60
  26.       Width           =   3030
  27.    End
  28.    Begin VB.CommandButton Exit 
  29.       Caption         =   "E X I T"
  30.       BeginProperty Font 
  31.          Name            =   "MS Sans Serif"
  32.          Size            =   9.75
  33.          Charset         =   0
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Height          =   480
  40.       Left            =   8400
  41.       TabIndex        =   9
  42.       Top             =   5400
  43.       Width           =   2250
  44.    End
  45.    Begin VB.CommandButton Vertical 
  46.       Caption         =   "Vertical Blinds"
  47.       BeginProperty Font 
  48.          Name            =   "MS Sans Serif"
  49.          Size            =   9.75
  50.          Charset         =   0
  51.          Weight          =   400
  52.          Underline       =   0   'False
  53.          Italic          =   0   'False
  54.          Strikethrough   =   0   'False
  55.       EndProperty
  56.       Height          =   390
  57.       Left            =   7500
  58.       TabIndex        =   11
  59.       Top             =   4035
  60.       Width           =   2055
  61.    End
  62.    Begin VB.CommandButton WipeRight 
  63.       Caption         =   "Wipe From Right"
  64.       BeginProperty Font 
  65.          Name            =   "MS Sans Serif"
  66.          Size            =   9.75
  67.          Charset         =   0
  68.          Weight          =   400
  69.          Underline       =   0   'False
  70.          Italic          =   0   'False
  71.          Strikethrough   =   0   'False
  72.       EndProperty
  73.       Height          =   390
  74.       Left            =   360
  75.       TabIndex        =   10
  76.       Top             =   4035
  77.       Width           =   1935
  78.    End
  79.    Begin VB.CommandButton WipeRightLeft 
  80.       Caption         =   "Wipe Right && Left"
  81.       BeginProperty Font 
  82.          Name            =   "MS Sans Serif"
  83.          Size            =   9.75
  84.          Charset         =   0
  85.          Weight          =   400
  86.          Underline       =   0   'False
  87.          Italic          =   0   'False
  88.          Strikethrough   =   0   'False
  89.       EndProperty
  90.       Height          =   390
  91.       Left            =   2700
  92.       TabIndex        =   8
  93.       Top             =   3585
  94.       Width           =   1935
  95.    End
  96.    Begin VB.CommandButton WipeUpDown 
  97.       Caption         =   "Wipe Up && Down"
  98.       BeginProperty Font 
  99.          Name            =   "MS Sans Serif"
  100.          Size            =   9.75
  101.          Charset         =   0
  102.          Weight          =   400
  103.          Underline       =   0   'False
  104.          Italic          =   0   'False
  105.          Strikethrough   =   0   'False
  106.       EndProperty
  107.       Height          =   390
  108.       Left            =   2700
  109.       TabIndex        =   7
  110.       Top             =   4035
  111.       Width           =   1935
  112.    End
  113.    Begin VB.CommandButton WipeCenter 
  114.       Caption         =   "Wipe From Center"
  115.       BeginProperty Font 
  116.          Name            =   "MS Sans Serif"
  117.          Size            =   9.75
  118.          Charset         =   0
  119.          Weight          =   400
  120.          Underline       =   0   'False
  121.          Italic          =   0   'False
  122.          Strikethrough   =   0   'False
  123.       EndProperty
  124.       Height          =   390
  125.       Left            =   2700
  126.       TabIndex        =   6
  127.       Top             =   4470
  128.       Width           =   1935
  129.    End
  130.    Begin VB.CommandButton StretchBottom 
  131.       Caption         =   "Stretch From Bottom"
  132.       BeginProperty Font 
  133.          Name            =   "MS Sans Serif"
  134.          Size            =   9.75
  135.          Charset         =   0
  136.          Weight          =   400
  137.          Underline       =   0   'False
  138.          Italic          =   0   'False
  139.          Strikethrough   =   0   'False
  140.       EndProperty
  141.       Height          =   390
  142.       Left            =   5055
  143.       TabIndex        =   5
  144.       Top             =   4035
  145.       Width           =   2085
  146.    End
  147.    Begin VB.CommandButton Horizontal 
  148.       Caption         =   "Horizontal Blinds"
  149.       BeginProperty Font 
  150.          Name            =   "MS Sans Serif"
  151.          Size            =   9.75
  152.          Charset         =   0
  153.          Weight          =   400
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       Height          =   390
  159.       Left            =   7500
  160.       TabIndex        =   4
  161.       Top             =   3585
  162.       Width           =   2055
  163.    End
  164.    Begin VB.CommandButton WipeLeft 
  165.       Caption         =   "Wipe From Left"
  166.       BeginProperty Font 
  167.          Name            =   "MS Sans Serif"
  168.          Size            =   9.75
  169.          Charset         =   0
  170.          Weight          =   400
  171.          Underline       =   0   'False
  172.          Italic          =   0   'False
  173.          Strikethrough   =   0   'False
  174.       EndProperty
  175.       Height          =   390
  176.       Left            =   360
  177.       TabIndex        =   3
  178.       Top             =   3585
  179.       Width           =   1935
  180.    End
  181.    Begin VB.CommandButton StretchRight 
  182.       Caption         =   "Stretch From Right"
  183.       BeginProperty Font 
  184.          Name            =   "MS Sans Serif"
  185.          Size            =   9.75
  186.          Charset         =   0
  187.          Weight          =   400
  188.          Underline       =   0   'False
  189.          Italic          =   0   'False
  190.          Strikethrough   =   0   'False
  191.       EndProperty
  192.       Height          =   390
  193.       Left            =   5055
  194.       TabIndex        =   2
  195.       Top             =   3585
  196.       Width           =   2085
  197.    End
  198.    Begin VB.PictureBox Picture2 
  199.       Height          =   3015
  200.       Left            =   5640
  201.       ScaleHeight     =   197
  202.       ScaleMode       =   3  'Pixel
  203.       ScaleWidth      =   317
  204.       TabIndex        =   1
  205.       Top             =   345
  206.       Width           =   4815
  207.    End
  208.    Begin VB.PictureBox Picture1 
  209.       Height          =   3045
  210.       Left            =   360
  211.       Picture         =   "wipes.frx":0000
  212.       ScaleHeight     =   199
  213.       ScaleMode       =   3  'Pixel
  214.       ScaleWidth      =   303
  215.       TabIndex        =   0
  216.       Top             =   330
  217.       Width           =   4605
  218.    End
  219. Attribute VB_Name = "WipesForm"
  220. Attribute VB_GlobalNameSpace = False
  221. Attribute VB_Creatable = False
  222. Attribute VB_PredeclaredId = True
  223. Attribute VB_Exposed = False
  224. Private Sub Exit_Click()
  225.     End
  226. End Sub
  227. Private Sub Vertical_Click()
  228. Dim Stripes As Integer
  229. Dim i, j As Integer
  230. Dim StripeHeight As Integer
  231. Picture2.Cls
  232. StripeWidth = 20
  233. Stripes = Picture1.ScaleWidth / StripeWidth
  234. On Error Resume Next
  235. For j = 1 To StripeWidth
  236. For i = 0 To Stripes
  237.     Picture2.PaintPicture Picture1.Picture, i * StripeWidth, 0, _
  238.         j, Picture1.ScaleHeight, _
  239.         i * StripeWidth, 0, _
  240.         j, Picture1.ScaleHeight, &HCC0020
  241. End Sub
  242. Private Sub Form_Load()
  243. Picture2.Width = Picture1.Width
  244. Picture2.Height = Picture1.Height
  245. Picture2.Top = Picture1.Top
  246. End Sub
  247. Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  248.     If Button <> 2 Then Exit Sub
  249.     CommonDialog1.Filter = "Images|*.BMP;*.GIF;*.JPG"
  250.     CommonDialog1.Action = 1
  251.     If CommonDialog1.filename = "" Then Exit Sub
  252.     Picture1.Picture = LoadPicture(CommonDialog1.filename)
  253.     Picture2.Width = Picture1.Width
  254.     Picture2.Height = Picture1.Height
  255. End Sub
  256. Private Sub Picture2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  257.     If Button <> 2 Then Exit Sub
  258.     CommonDialog1.Filter = "Images|*.BMP;*.GIF;*.JPG"
  259.     CommonDialog1.Action = 1
  260.     If CommonDialog1.filename = "" Then Exit Sub
  261.     Picture2.Picture = LoadPicture(CommonDialog1.filename)
  262. End Sub
  263. Private Sub StretchRight_Click()
  264. Dim X
  265.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  266.     For X = 1 To Picture1.ScaleWidth Step 3
  267.         Picture2.PaintPicture Picture1.Picture, 0, 0, _
  268.         Picture1.ScaleWidth, Picture1.ScaleHeight, 0, 0, X, _
  269.         Picture1.ScaleHeight, &HCC0020
  270.     Next
  271. End Sub
  272. Private Sub WipeLeft_Click()
  273. Dim X
  274.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  275.     For X = 1 To Picture1.ScaleWidth
  276.         Picture2.PaintPicture Picture1.Picture, 0, 0, _
  277.         X, Picture1.ScaleHeight, 0, 0, X, _
  278.         Picture1.ScaleHeight, &HCC0020
  279.     Next
  280. End Sub
  281. Private Sub StretchBottom_Click()
  282. Dim X
  283.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  284.     For X = 1 To Picture1.ScaleHeight Step 3
  285.         Picture2.PaintPicture Picture1.Picture, 0, 0, _
  286.         Picture1.ScaleWidth, Picture1.ScaleHeight, 0, 0, _
  287.         Picture1.ScaleWidth, X, &HCC0020
  288.     Next
  289. End Sub
  290. Private Sub WipeCenter_Click()
  291. Dim PWidth, PHeight As Integer
  292. Dim i As Integer
  293.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  294.     If Picture1.ScaleWidth > Picture1.ScaleHeight Then
  295.         PWidth = Picture1.ScaleWidth - Picture1.ScaleHeight
  296.         PHeight = 1
  297.     ElseIf Picture1.ScaleWidth < Picture1.ScaleHeight Then
  298.         PWidth = 1
  299.         PHeight = Picture1.ScaleHeight - Picture1.ScaleWidth
  300.     Else
  301.         PWidth = 1
  302.         PHeight = 1
  303.     End If
  304.     For i = 1 To Picture1.ScaleWidth - PWidth
  305.         Picture2.PaintPicture Picture1.Picture, _
  306.         Int((Picture1.ScaleWidth - PWidth) / 2), Int((Picture1.ScaleHeight - PHeight) / 2), _
  307.         PWidth, PHeight, _
  308.         Int((Picture1.ScaleWidth - PWidth) / 2), Int((Picture1.ScaleHeight - PHeight) / 2), _
  309.         PWidth, PHeight, &HCC0020
  310.         PWidth = PWidth + 1
  311.         PHeight = PHeight + 1
  312.     Next
  313. End Sub
  314. Private Sub Horizontal_Click()
  315. Dim Stripes As Integer
  316. Dim i, j As Integer
  317. Dim StripeHeight As Integer
  318.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  319.     StripeHeight = 20
  320.     Stripes = Fix(Picture1.ScaleHeight / StripeHeight)
  321.     On Error Resume Next
  322.     For j = 1 To StripeHeight
  323.         For i = 0 To Stripes
  324.             Picture2.PaintPicture Picture1.Picture, 0, i * StripeHeight, _
  325.             Picture1.ScaleWidth, j, _
  326.             0, i * StripeHeight, _
  327.             Picture1.ScaleWidth, j, &HCC0020
  328.         Next
  329.     Next
  330. End Sub
  331. Private Sub WipeRight_Click()
  332. Dim X As Integer
  333.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  334.     For X = 1 To Picture1.ScaleWidth
  335.         Picture2.PaintPicture Picture1.Picture, _
  336.         Picture1.ScaleWidth - X, 0, _
  337.         X, Picture1.ScaleHeight, _
  338.         Picture1.ScaleWidth - X, 0, _
  339.         X, Picture1.ScaleHeight, &HCC0020
  340.     Next
  341. End Sub
  342. Private Sub WipeUpDown_Click()
  343. Dim PWidth, PHeight As Integer
  344. Dim i As Integer
  345.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  346.     PWidth = Picture1.ScaleWidth
  347.     PHeight = 1
  348.     For i = 1 To Picture1.ScaleHeight / 2
  349.         Picture2.PaintPicture Picture1.Picture, _
  350.         0, (Picture1.ScaleHeight - PHeight) / 2, _
  351.         PWidth, PHeight, _
  352.         0, (Picture1.ScaleHeight - PHeight) / 2, _
  353.         PWidth, PHeight, &HCC0020
  354.         PHeight = PHeight + 2
  355.     Next
  356. End Sub
  357. Private Sub WipeRightLeft_Click()
  358. Dim PWidth, PHeight As Integer
  359. Dim i As Integer
  360.     If ClearDestination.Value Then Picture2.Picture = LoadPicture()
  361.     PWidth = 1
  362.     PHeight = Picture1.ScaleHeight
  363.     For i = 1 To Picture1.ScaleWidth / 2
  364.         Picture2.PaintPicture Picture1.Picture, _
  365.         (Picture1.ScaleWidth - PWidth) / 2, 0, _
  366.         PWidth, PHeight, _
  367.         (Picture1.ScaleWidth - PWidth) / 2, 0, _
  368.         PWidth, PHeight, &HCC0020
  369.         PWidth = PWidth + 2
  370.     Next
  371. End Sub
  372.