home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Mask Copy"
- ClientHeight = 3645
- ClientLeft = 1185
- ClientTop = 1965
- ClientWidth = 8685
- Height = 4425
- Left = 1125
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3645
- ScaleWidth = 8685
- Top = 1245
- Width = 8805
- Begin VB.CommandButton cmdDarken
- Caption = "&Darken"
- Height = 375
- Left = 7080
- TabIndex = 6
- Top = 3240
- Width = 1575
- End
- Begin VB.CommandButton cmdLighten
- Caption = "&Lighten"
- Height = 375
- Left = 5400
- TabIndex = 5
- Top = 3240
- Width = 1575
- End
- Begin VB.CommandButton cmdGridify
- Caption = "&Gridify"
- Height = 375
- Left = 3720
- TabIndex = 4
- Top = 3240
- Width = 1575
- End
- Begin VB.CommandButton cmdComposite
- Caption = "&Composite Images"
- Height = 375
- Left = 120
- TabIndex = 0
- Top = 3240
- Width = 1575
- End
- Begin ik32Lib.Picbuf PicbufDest
- Height = 2895
- Left = 5880
- TabIndex = 9
- Top = 240
- Width = 2775
- _Version = 65536
- _ExtentX = 4895
- _ExtentY = 5106
- _StockProps = 253
- End
- Begin ik32Lib.Picbuf PicbufMask
- Height = 2895
- Left = 3000
- TabIndex = 8
- Top = 240
- Width = 2775
- _Version = 65536
- _ExtentX = 4895
- _ExtentY = 5106
- _StockProps = 253
- End
- Begin ik32Lib.Picbuf PicbufSrc
- Height = 2895
- Left = 120
- TabIndex = 7
- Top = 240
- Width = 2775
- _Version = 65536
- _ExtentX = 4895
- _ExtentY = 5106
- _StockProps = 253
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 3840
- Top = 0
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- End
- Begin VB.Label Label3
- Caption = "Destination:"
- Height = 255
- Left = 5880
- TabIndex = 3
- Top = 0
- Width = 1095
- End
- Begin VB.Label Label2
- Caption = "Mask:"
- Height = 255
- Left = 3000
- TabIndex = 2
- Top = 0
- Width = 1095
- End
- Begin VB.Label Label1
- Caption = "Source:"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 0
- Width = 1215
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuLoadSource
- Caption = "Load &Source Image..."
- End
- Begin VB.Menu mnuLoadMask
- Caption = "Load &Mask Image..."
- End
- Begin VB.Menu mnuLoadDestination
- Caption = "Load &Destination Image..."
- End
- Begin VB.Menu mnuSaveDestinationAs
- Caption = "Save D&estination Image..."
- End
- Begin VB.Menu mnuSpacer
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- Shortcut = ^X
- End
- End
- Begin VB.Menu mnuReload
- Caption = "&Reload"
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- 'Description: This code uses the MaskCopy method
- 'to composite two images together using a mask
- Private Sub cmdComposite_Click()
- Call PicbufDest.MaskCopy(PicbufSrc, PicbufMask)
- End Sub
- 'Description: This code darkens the destination image.
- Private Sub cmdDarken_Click()
- PicbufSrc.Init 24, PicbufDest.Xresolution, PicbufDest.Yresolution, RGB(0, 0, 0)
- PicbufMask.Init 24, PicbufDest.Xresolution, PicbufDest.Yresolution, RGB(75, 75, 75)
- cmdComposite_Click
- End Sub
- 'Description: this code creates a grid, and then
- 'applies it to an image using the MaskCopy method
- Private Sub cmdGridify_Click()
- Dim Color1, Color2 As Long, Index As Integer
- ReDim scanline0(0 To PicbufDest.Xresolution) As Long
- ReDim scanline1(0 To PicbufDest.Xresolution) As Long
- 'clear images from source and mask picbufs
- PicbufSrc.Clear
- PicbufMask.Clear
- 'initialize the source picbuf with a white image
- Call PicbufSrc.Init(24, PicbufDest.Xresolution, PicbufDest.Yresolution, RGB(255, 255, 255))
- 'initialize white and black colors
- Color1 = RGB(0, 0, 0)
- Color2 = RGB(255, 255, 255)
- For Index = LBound(scanline0) To UBound(scanline0)
- If Index Mod 2 = 0 Then
- scanline0(Index) = Color1
- scanline1(Index) = Color2
- Else
- scanline0(Index) = Color2
- scanline1(Index) = Color1
- End If
- Next
- For Index = 0 To PicbufDest.Yresolution - 1
- If Index Mod 10 = 0 Then
- Call PicbufSrc.PutScanLine(Index, scanline0(0))
- Else
- Call PicbufSrc.PutScanLine(Index, scanline1(0))
- End If
- Next
- PicbufMask.Assign False, PicbufSrc, False
- PicbufMask.Negate
- cmdComposite_Click
- End Sub
- 'Description: This code lightens the destination
- 'image using maskcopy.
- Private Sub cmdLighten_Click()
- PicbufSrc.Init 24, PicbufDest.Xresolution, PicbufDest.Yresolution, RGB(255, 255, 255)
- PicbufMask.Init 24, PicbufDest.Xresolution, PicbufDest.Yresolution, RGB(75, 75, 75)
- cmdComposite_Click
- End Sub
- 'Description: Here we set all of the presets
- Private Sub Form_Load()
- 'init picbufs
- InitPicbuf PicbufSrc, True, "Squirrel.bmp"
- InitPicbuf PicbufMask, True, "Sqcutout.bmp"
- InitPicbuf PicbufDest, True, "Balloon.bmp"
- End Sub
- 'Description: This code exits the program
- Private Sub mnuExit_Click()
- ExitProgram
- End Sub
- 'Description: This code uses the Common Dialog
- 'control to determine a file name, and then loads
- 'the image into a picbuf
- Private Sub ikLoadDestination_Click()
- LoadImage PicbufDest, CommonDialog1
- End Sub
- 'Description: This code uses the Common Dialog
- 'control to determine a file name, and then loads
- 'the image into a picbuf
- Private Sub mnuLoadDestination_Click()
- LoadImage PicbufDest, CommonDialog1
- End Sub
- 'Description: This code uses the Common Dialog
- 'control to determine a file name, and then loads
- 'the image into a picbuf
- Private Sub mnuLoadMask_Click()
- LoadImage PicbufMask, CommonDialog1
- End Sub
- 'Description: This code uses the Common Dialog
- 'control to determine a file name, and then loads
- 'the image into a picbuf
- Private Sub mnuLoadSource_Click()
- LoadImage PicbufSrc, CommonDialog1
- End Sub
- 'Description: This code reloads all of the images.
- Private Sub mnuReload_Click()
- PicbufSrc.Load
- PicbufMask.Load
- PicbufDest.Load
- End Sub
- 'Description: This code uses the Common Dialog
- 'control to determine a file name, and then stores
- 'the image.
- Private Sub mnuSaveDestinationAs_Click()
- SaveImage PicbufDest, CommonDialog1
- End Sub
-