home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Rubber"
- ClientHeight = 5670
- ClientLeft = 1605
- ClientTop = 2010
- ClientWidth = 7095
- Height = 6360
- Left = 1545
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5670
- ScaleWidth = 7095
- Top = 1380
- Width = 7215
- Begin VB.Frame Frame4
- Caption = "Draw Properties"
- Height = 1455
- Left = 120
- TabIndex = 28
- Top = 4080
- Width = 4215
- Begin VB.TextBox txtDW
- Height = 285
- Left = 120
- TabIndex = 1
- Text = "txtDW"
- Top = 960
- Width = 735
- End
- Begin VB.CommandButton cmdFC
- Caption = "F&ore Color"
- Height = 375
- Left = 3000
- TabIndex = 13
- Top = 840
- Width = 1095
- End
- Begin VB.CommandButton cmdBC
- Caption = "&Back Color"
- Height = 375
- Left = 3000
- TabIndex = 12
- Top = 240
- Width = 1095
- End
- Begin VB.ComboBox cmbRO
- Height = 315
- Left = 120
- TabIndex = 0
- Text = "cmbRO"
- Top = 480
- Width = 1815
- End
- Begin VB.Shape Shape2
- BackColor = &H00000000&
- BackStyle = 1 'Opaque
- Height = 375
- Left = 2040
- Top = 840
- Width = 855
- End
- Begin VB.Shape Shape1
- BackColor = &H00000000&
- BackStyle = 1 'Opaque
- Height = 375
- Left = 2040
- Top = 240
- Width = 855
- End
- Begin VB.Label Label12
- Caption = "RasterOp"
- Height = 255
- Left = 120
- TabIndex = 30
- Top = 240
- Width = 735
- End
- Begin VB.Label Label11
- Caption = "DrawWidth"
- Height = 255
- Left = 960
- TabIndex = 29
- Top = 960
- Width = 1215
- End
- End
- Begin VB.Frame Frame3
- Caption = "Scale Properties"
- Height = 1215
- Left = 4440
- TabIndex = 25
- Top = 0
- Width = 2535
- Begin VB.TextBox txtSS
- Height = 285
- Left = 120
- TabIndex = 3
- Text = "txtSS"
- Top = 720
- Width = 1215
- End
- Begin VB.TextBox txtSI
- Height = 285
- Left = 120
- TabIndex = 2
- Text = "txtSI"
- Top = 360
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "ScaleScreen"
- Height = 255
- Left = 1440
- TabIndex = 27
- Top = 720
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "ScaleImage"
- Height = 255
- Left = 1440
- TabIndex = 26
- Top = 360
- Width = 855
- End
- End
- Begin VB.Frame Frame2
- Caption = "Print Properties"
- Height = 1935
- Left = 4440
- TabIndex = 20
- Top = 3600
- Width = 2535
- Begin VB.TextBox txtPrnH
- Height = 285
- Left = 120
- TabIndex = 11
- Text = "txtPrnH"
- Top = 1440
- Width = 1215
- End
- Begin VB.TextBox txtPrnW
- Height = 285
- Left = 120
- TabIndex = 10
- Text = "txtPrnW"
- Top = 1080
- Width = 1215
- End
- Begin VB.TextBox txtPrnT
- Height = 285
- Left = 120
- TabIndex = 9
- Text = "txtPrnT"
- Top = 720
- Width = 1215
- End
- Begin VB.TextBox txtPrnL
- Height = 285
- Left = 120
- TabIndex = 8
- Text = "txtPrnL"
- Top = 360
- Width = 1215
- End
- Begin VB.Label Label10
- Caption = "PrintHeight"
- Height = 255
- Left = 1440
- TabIndex = 24
- Top = 1440
- Width = 855
- End
- Begin VB.Label Label9
- Caption = "PrintWidth"
- Height = 255
- Left = 1440
- TabIndex = 23
- Top = 1080
- Width = 855
- End
- Begin VB.Label Label8
- Caption = "PrintTop"
- Height = 255
- Left = 1440
- TabIndex = 22
- Top = 720
- Width = 735
- End
- Begin VB.Label Label7
- Caption = "PrintLeft"
- Height = 255
- Left = 1440
- TabIndex = 21
- Top = 360
- Width = 975
- End
- End
- Begin VB.Frame Frame1
- Caption = "Select Properties"
- Height = 1935
- Left = 4440
- TabIndex = 15
- Top = 1440
- Width = 2535
- Begin VB.TextBox txtSelH
- Height = 285
- Left = 120
- TabIndex = 7
- Text = "txtSelH"
- Top = 1440
- Width = 1215
- End
- Begin VB.TextBox txtSelW
- Height = 285
- Left = 120
- TabIndex = 6
- Text = "txtSelW"
- Top = 1080
- Width = 1215
- End
- Begin VB.TextBox txtSelT
- Height = 285
- Left = 120
- TabIndex = 5
- Text = "txtSelT"
- Top = 720
- Width = 1215
- End
- Begin VB.TextBox txtSelL
- Height = 285
- Left = 120
- TabIndex = 4
- Text = "txtSelL"
- Top = 360
- Width = 1215
- End
- Begin VB.Label Label6
- Caption = "SelectHeight"
- Height = 255
- Left = 1440
- TabIndex = 19
- Top = 1440
- Width = 975
- End
- Begin VB.Label Label5
- Caption = "SelectWidth"
- Height = 255
- Left = 1440
- TabIndex = 18
- Top = 1080
- Width = 975
- End
- Begin VB.Label Label4
- Caption = "SelectTop"
- Height = 255
- Left = 1440
- TabIndex = 17
- Top = 720
- Width = 855
- End
- Begin VB.Label Label3
- Caption = "SelectLeft"
- Height = 255
- Left = 1440
- TabIndex = 16
- Top = 360
- Width = 975
- End
- End
- Begin ik32Lib.Picbuf Picbuf1
- Height = 3975
- Left = 120
- TabIndex = 14
- Top = 0
- Width = 4215
- _Version = 65536
- _ExtentX = 7435
- _ExtentY = 7011
- _StockProps = 253
- ScrollBars = 3
- End
- Begin MSComDlg.CommonDialog CommonDialog
- Left = 6480
- Top = 3240
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuLoad
- Caption = "&Load Image..."
- End
- Begin VB.Menu mnuFileOpen8BitWhite
- Caption = "Load &8 bit White"
- End
- Begin VB.Menu mnuFileOpen24BitWhite
- Caption = "Load &24 bit White"
- End
- Begin VB.Menu mnuFileOpen8BitRGB
- Caption = "Load 8 bit &RGB"
- End
- Begin VB.Menu mnuFileOpen24BitRGB
- Caption = "Load 24 bit R&GB"
- End
- Begin VB.Menu mnuSave
- Caption = "&Save Image..."
- End
- Begin VB.Menu mnuSpacer
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuZoom
- Caption = "&Zoom"
- Begin VB.Menu mnuZoomIn
- Caption = "&In"
- End
- Begin VB.Menu mnuZoomOut
- Caption = "&Out"
- End
- End
- Begin VB.Menu mnuUpdate
- Caption = "&Update"
- Begin VB.Menu mnuUpdateSelP
- Caption = "&Select Properties"
- Checked = -1 'True
- End
- Begin VB.Menu mnuUpdatePrnP
- Caption = "&Print Properties"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim nInc As Integer
- ' Sets the drawing parameters
- Sub SetDraw()
- Picbuf1.DrawWidth = CInt(txtDW.Text)
- Picbuf1.RasterOp = cmbRO.ListIndex
- End Sub
- Sub SetPrintProps()
- txtPrnL.Text = Str$(Picbuf1.PrintLeft)
- txtPrnT.Text = Str$(Picbuf1.PrintTop)
- txtPrnW.Text = Str$(Picbuf1.PrintWidth)
- txtPrnH.Text = Str$(Picbuf1.PrintHeight)
- End Sub
- Sub SetScaleProps()
- txtSI.Text = Str$(Picbuf1.ScaleImage)
- txtSS.Text = Str$(Picbuf1.ScaleScreen)
- End Sub
- Sub SetSelectProps()
- txtSelL.Text = Str$(Picbuf1.SelectLeft)
- txtSelT.Text = Str$(Picbuf1.SelectTop)
- txtSelW.Text = Str$(Picbuf1.SelectWidth)
- txtSelH.Text = Str$(Picbuf1.SelectHeight)
- End Sub
- Sub ToggleUpdateMenu()
- mnuUpdatePrnP.Checked = Not mnuUpdatePrnP.Checked
- mnuUpdateSelP.Checked = Not mnuUpdateSelP.Checked
- End Sub
- Sub Zoom(nOption As Integer)
- If nOption = 1 Then
- ' zoom out
- If Picbuf1.ScaleScreen > 1 Then
- Picbuf1.ScaleScreen = Picbuf1.ScaleScreen - nInc
- Else
- Picbuf1.ScaleImage = Picbuf1.ScaleImage + nInc
- End If
- Else
- ' zoom in
- If Picbuf1.ScaleImage > 1 Then
- Picbuf1.ScaleImage = Picbuf1.ScaleImage - nInc
- Else
- Picbuf1.ScaleScreen = Picbuf1.ScaleScreen + nInc
- End If
- End If
- SetScaleProps
- End Sub
- Private Sub cmdBC_Click()
- Picbuf1.BackColor = GetColor(CommonDialog)
- Shape1.BackColor = Picbuf1.BackColor
- End Sub
- Private Sub cmdFC_Click()
- Picbuf1.ForeColor = GetColor(CommonDialog)
- Shape2.BackColor = Picbuf1.ForeColor
- End Sub
- Private Sub Form_Load()
- Picbuf1.DrawWidth = 1
- txtDW.Text = Str$(Picbuf1.DrawWidth)
- Picbuf1.RasterOp = RONOT
- nInc = 5
- nUpdateOption = 0 ' Select Properties the default
- InitPicbuf Picbuf1, True
- Picbuf1.Init 8, 200, 200, RGB(255, 255, 255)
- ' Colors
- Picbuf1.BackColor = RGB(255, 0, 0)
- Picbuf1.ForeColor = RGB(0, 0, 0)
- Shape1.BackColor = Picbuf1.BackColor
- Shape2.BackColor = Picbuf1.ForeColor
- ' RasterOp
- InitcmbRasterOp cmbRO, Picbuf1.RasterOp
- 'Init the Scale properties
- SetScaleProps
- 'Init the Select properties
- SetSelectProps
- 'Init the Print properties
- SetPrintProps
- End Sub
- Private Sub mnuExit_Click()
- ExitProgram
- End Sub
- Private Sub mnuFileOpen24BitRGB_Click()
- InitPicbuf Picbuf1, True, "Rgb24.bmp"
- End Sub
- Private Sub mnuFileOpen24BitWhite_Click()
- InitPicbuf Picbuf1, True, "White24.bmp"
- End Sub
- Private Sub mnuFileOpen8BitRGB_Click()
- InitPicbuf Picbuf1, True, "Rgb8.bmp"
- End Sub
- Private Sub mnuFileOpen8BitWhite_Click()
- InitPicbuf Picbuf1, True, "White8.bmp"
- End Sub
- Private Sub mnuLoad_Click()
- LoadImage Picbuf1, CommonDialog
- End Sub
- Private Sub mnuSave_Click()
- SaveImage Picbuf1, CommonDialog
- End Sub
- Private Sub mnuUpdatePrnP_Click()
- ToggleUpdateMenu
- End Sub
- Private Sub mnuUpdateSelP_Click()
- ToggleUpdateMenu
- End Sub
- Private Sub mnuZoomIn_Click()
- Zoom 0
- End Sub
- Private Sub mnuZoomOut_Click()
- Zoom 1
- End Sub
- ' Capture the mouse and update the
- ' Select or Print Properties
- Private Sub Picbuf1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' what to update
- Dim nOption As Integer
- If mnuUpdateSelP.Checked = True Then
- nOption = RTSelect
- Else
- nOption = RTPrint
- End If
- ' update draw width & raster operations
- SetDraw
-
- ' update
- Picbuf1.RegionRb nOption
- End Sub
- ' Update Select or Print Values
- Private Sub Picbuf1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If mnuUpdateSelP.Checked = True Then
- SetSelectProps
- Else
- SetPrintProps
- End If
- End Sub
-