home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BorderStyle = 1 'Fixed Single
- Caption = "Scanline"
- ClientHeight = 3255
- ClientLeft = 1680
- ClientTop = 3600
- ClientWidth = 9375
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 3975
- Left = 1620
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 217
- ScaleMode = 3 'Pixel
- ScaleWidth = 625
- Top = 2940
- Width = 9495
- Begin VB.TextBox txtyPixel
- BackColor = &H00FFFFFF&
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 288
- Left = 1560
- TabIndex = 2
- Text = "txtyPixel"
- Top = 720
- Width = 972
- End
- Begin VB.TextBox txtXpixel
- BackColor = &H00FFFFFF&
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 288
- Left = 1560
- TabIndex = 1
- Text = "txtxPixel"
- Top = 240
- Width = 972
- End
- Begin VB.CommandButton cmdPerformScanline
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "&Perform Scanline"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 120
- TabIndex = 0
- Top = 2760
- Width = 2415
- End
- Begin ik32Lib.Picbuf PicbufDest
- Height = 2895
- Left = 6000
- TabIndex = 8
- Top = 240
- Width = 3255
- _Version = 65536
- _ExtentX = 5741
- _ExtentY = 5106
- _StockProps = 253
- BackColor = 0
- Appearance = 1
- End
- Begin ik32Lib.Picbuf PicbufSrc
- Height = 2895
- Left = 2640
- TabIndex = 7
- Top = 240
- Width = 3255
- _Version = 65536
- _ExtentX = 5741
- _ExtentY = 5106
- _StockProps = 253
- BackColor = 0
- Appearance = 1
- End
- Begin VB.Shape Shape1
- BackStyle = 1 'Opaque
- Height = 645
- Left = 180
- Top = 1440
- Width = 2355
- End
- Begin VB.Label Label4
- Caption = "Mask Color:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 90
- TabIndex = 10
- Top = 1170
- Width = 1275
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 2160
- Top = 2160
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- End
- Begin VB.Label Label3
- Alignment = 2 'Center
- Caption = "Click on the Source Picbuf to choose a transparency color."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 240
- TabIndex = 9
- Top = 2160
- Width = 2175
- End
- Begin VB.Label Label2
- Appearance = 0 'Flat
- Caption = "Destination Picbuf"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 6000
- TabIndex = 6
- Top = 0
- Width = 2655
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- Caption = "Source Picbuf (Transparency)"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 2640
- TabIndex = 5
- Top = 0
- Width = 2775
- End
- Begin VB.Label lblYpixel
- Appearance = 0 'Flat
- Caption = "Mask Color Pixel Y:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 90
- TabIndex = 4
- Top = 720
- Width = 1455
- End
- Begin VB.Label LblXpixel
- Appearance = 0 'Flat
- Caption = "Mask Color Pixel X:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 90
- TabIndex = 3
- Top = 240
- Width = 1575
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuLoadSrc
- Caption = "Load &Source..."
- End
- Begin VB.Menu mnuLoadDest
- Caption = "Load &Destination..."
- End
- Begin VB.Menu mnuSaveDest
- Caption = "&Save Destination..."
- End
- Begin VB.Menu mnuSpacer
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuReload
- Caption = "&Reload"
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub cmdperformscanline_Click()
- Dim Index, Index2 As Integer
- Dim MaskColor As Double
- ReDim srcscanline(0 To PicbufSrc.Xresolution - 1) As Long
- ReDim destscanline(0 To PicbufDest.Xresolution - 1) As Long
-
- If PicbufSrc.ColorDepth > PicbufDest.ColorDepth Then
- PicbufDest.IncreaseColors PicbufSrc.ColorDepth
- End If
-
- If PicbufSrc.ColorDepth < PicbufDest.ColorDepth Then
- PicbufSrc.IncreaseColors PicbufDest.ColorDepth
- End If
-
- If PicbufSrc.ColorDepth < 24 Then
- PicbufDest.DitherPal PicbufSrc
- MaskColor = PicbufSrc.GetPalIndex(Val(TxtXPixel), Val(TxtYPixel))
- Else
- MaskColor = PicbufSrc.GetColor(Val(TxtXPixel), Val(TxtYPixel))
- End If
- For Index = 0 To PicbufSrc.Yresolution - 1
- PicbufSrc.GetScanLine Index, srcscanline(0)
- PicbufDest.GetScanLine Index, destscanline(0)
- For Index2 = 0 To PicbufSrc.Xresolution - 1
- If srcscanline(Index2) <> MaskColor Then
- destscanline(Index2) = srcscanline(Index2)
- End If
- Next
- PicbufDest.PutScanLine Index, destscanline(0)
- Next
- MsgBox "Done!"
- End Sub
- Private Sub Form_Load()
- InitPicbuf PicbufSrc, True, "Bambi1.bmp"
- InitPicbuf PicbufDest, True, "Winlogo1.bmp"
- PicbufSrc.MousePointer = 2
- TxtXPixel.Text = "0"
- TxtYPixel.Text = "0"
- End Sub
- Private Sub mnuExit_Click()
- ExitProgram
- End Sub
- Private Sub mnuLoadDest_Click()
- LoadImage PicbufDest, commondialog1
- End Sub
- Private Sub mnuLoadSrc_Click()
- LoadImage PicbufSrc, commondialog1
- End Sub
- Private Sub mnuReload_Click()
- PicbufSrc.Load
- PicbufDest.Load
- End Sub
- Private Sub mnuSaveDest_Click()
- SaveImage PicbufDest, commondialog1
- End Sub
- Private Sub PicbufSrc_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- TxtXPixel = Format$(x \ Screen.TwipsPerPixelX)
- TxtYPixel = Format$(y \ Screen.TwipsPerPixelY)
- cmdperformscanline.Enabled = True
- End Sub
- Private Sub TxtXPixel_Change()
- Shape1.BackColor = PicbufSrc.GetColor(Val(TxtXPixel.Text), Val(TxtYPixel.Text))
- End Sub
- Private Sub TxtYPixel_Change()
- Shape1.BackColor = PicbufSrc.GetColor(Val(TxtXPixel.Text), Val(TxtYPixel.Text))
- End Sub
-