home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Draw
- BorderStyle = 1 'Fixed Single
- Caption = "Draw"
- ClientHeight = 6135
- ClientLeft = 435
- ClientTop = 2055
- ClientWidth = 7935
- ClipControls = 0 'False
- Height = 6825
- Left = 375
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 409
- ScaleMode = 3 'Pixel
- ScaleWidth = 529
- Top = 1425
- Width = 8055
- Begin VB.Frame Frame4
- Caption = "Color Properties"
- Height = 5295
- Left = 5760
- TabIndex = 26
- Top = 0
- Width = 2055
- Begin VB.PictureBox pictFillC
- Height = 975
- Left = 1320
- ScaleHeight = 915
- ScaleWidth = 555
- TabIndex = 73
- Top = 4080
- Width = 615
- End
- Begin VB.PictureBox pictBC
- Height = 975
- Left = 1320
- ScaleHeight = 915
- ScaleWidth = 555
- TabIndex = 72
- Top = 2400
- Width = 615
- End
- Begin VB.PictureBox pictFC
- Height = 975
- Left = 1320
- ScaleHeight = 915
- ScaleWidth = 555
- TabIndex = 71
- Top = 720
- Width = 615
- End
- Begin VB.TextBox txtFillCBlue
- Height = 285
- Left = 120
- TabIndex = 44
- Text = "txtFillCBlue"
- Top = 4800
- Width = 495
- End
- Begin VB.TextBox txtFillCGreen
- Height = 285
- Left = 120
- TabIndex = 43
- Text = "txtFillCGreen"
- Top = 4440
- Width = 495
- End
- Begin VB.TextBox txtFillCRed
- Height = 285
- Left = 120
- TabIndex = 42
- Text = "txtFillCRed"
- Top = 4080
- Width = 495
- End
- Begin VB.CommandButton cmdFillC
- Caption = "Set F&ill Color"
- Height = 375
- Left = 120
- TabIndex = 41
- Top = 3600
- Width = 1815
- End
- Begin VB.TextBox txtBCBlue
- Height = 285
- Left = 120
- TabIndex = 37
- Text = "txtBCBlue"
- Top = 3120
- Width = 495
- End
- Begin VB.TextBox txtBCGreen
- Height = 285
- Left = 120
- TabIndex = 36
- Text = "txtBCGreen"
- Top = 2760
- Width = 495
- End
- Begin VB.TextBox txtBCRed
- Height = 285
- Left = 120
- TabIndex = 35
- Text = "txtBCRed"
- Top = 2400
- Width = 495
- End
- Begin VB.CommandButton cmdBC
- Caption = "Set &Background Color"
- Height = 375
- Left = 120
- TabIndex = 31
- Top = 1920
- Width = 1815
- End
- Begin VB.TextBox txtFCGreen
- Height = 285
- Left = 120
- TabIndex = 30
- Text = "txtFCGreen"
- Top = 1080
- Width = 495
- End
- Begin VB.TextBox txtFCBlue
- Height = 285
- Left = 120
- TabIndex = 29
- Text = "txtFCBlue"
- Top = 1440
- Width = 495
- End
- Begin VB.TextBox txtFCRed
- Height = 285
- Left = 120
- TabIndex = 28
- Text = "txtFCRed"
- Top = 720
- Width = 495
- End
- Begin VB.CommandButton cmdFC
- Caption = "Set F&oreground Color"
- Height = 375
- Left = 120
- TabIndex = 27
- Top = 240
- Width = 1815
- End
- Begin VB.Label Label19
- Caption = "Green"
- Height = 255
- Left = 720
- TabIndex = 47
- Top = 4440
- Width = 495
- End
- Begin VB.Label Label18
- Caption = "Blue"
- Height = 255
- Left = 720
- TabIndex = 46
- Top = 4800
- Width = 495
- End
- Begin VB.Label Label17
- Caption = "Red"
- Height = 255
- Left = 720
- TabIndex = 45
- Top = 4080
- Width = 615
- End
- Begin VB.Label Label11
- Caption = "Blue"
- Height = 255
- Left = 720
- TabIndex = 40
- Top = 3120
- Width = 615
- End
- Begin VB.Label Label10
- Caption = "Green"
- Height = 255
- Left = 720
- TabIndex = 39
- Top = 2760
- Width = 495
- End
- Begin VB.Label Label9
- Caption = "Red"
- Height = 255
- Left = 720
- TabIndex = 38
- Top = 2400
- Width = 615
- End
- Begin VB.Label Label8
- Caption = "Blue"
- Height = 255
- Left = 720
- TabIndex = 34
- Top = 1440
- Width = 615
- End
- Begin VB.Label Label7
- Caption = "Green"
- Height = 255
- Left = 720
- TabIndex = 33
- Top = 1080
- Width = 495
- End
- Begin VB.Label Label6
- Caption = "Red"
- Height = 255
- Left = 720
- TabIndex = 32
- Top = 720
- Width = 735
- End
- End
- Begin VB.Frame Frame1
- Caption = "Select Properties"
- ClipControls = 0 'False
- Height = 615
- Left = 3000
- TabIndex = 0
- Top = 5400
- Width = 4815
- Begin VB.TextBox txtSH
- Height = 285
- Left = 4080
- TabIndex = 6
- Text = "txtSH"
- Top = 240
- Width = 615
- End
- Begin VB.TextBox txtSW
- Height = 285
- Left = 2880
- TabIndex = 5
- Text = "txtSW"
- Top = 240
- Width = 615
- End
- Begin VB.TextBox txtST
- Height = 285
- Left = 480
- TabIndex = 3
- Text = "txtST"
- Top = 240
- Width = 615
- End
- Begin VB.TextBox txtSL
- Height = 285
- Left = 1680
- TabIndex = 1
- Text = "txtSL"
- Top = 240
- Width = 615
- End
- Begin VB.Label Label3
- Caption = "Height"
- Height = 255
- Left = 3600
- TabIndex = 8
- Top = 240
- Width = 975
- End
- Begin VB.Label Label2
- Caption = "Width"
- Height = 255
- Left = 2400
- TabIndex = 7
- Top = 240
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Top"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 240
- Width = 975
- End
- Begin VB.Label Label5
- Caption = "Left"
- Height = 255
- Left = 1320
- TabIndex = 2
- Top = 240
- Width = 855
- End
- End
- Begin VB.Frame Frame12
- Caption = "Text Attributes"
- Height = 3015
- Left = 120
- TabIndex = 94
- Top = 2280
- Width = 1575
- Begin VB.TextBox txtText
- Height = 615
- Left = 120
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 100
- Top = 480
- Width = 1335
- End
- Begin VB.ComboBox cmbTA
- Height = 315
- Left = 120
- TabIndex = 98
- Text = "cmbTA"
- Top = 1440
- Width = 1335
- End
- Begin VB.CheckBox chkTML
- Caption = "TextMultiLine"
- Height = 255
- Left = 120
- TabIndex = 97
- Top = 2640
- Width = 1335
- End
- Begin VB.CheckBox chkTA
- Caption = "TextAutoSize"
- Height = 255
- Left = 120
- TabIndex = 95
- Top = 1920
- Width = 1335
- End
- Begin VB.CheckBox chkTEL
- Caption = "TextExtLeading"
- Height = 255
- Left = 120
- TabIndex = 96
- Top = 2280
- Width = 1425
- End
- Begin VB.Label Label30
- Caption = "Text To Draw"
- Height = 255
- Left = 120
- TabIndex = 101
- Top = 240
- Width = 1095
- End
- Begin VB.Label Label38
- Caption = "TextAlignment"
- Height = 375
- Left = 120
- TabIndex = 99
- Top = 1200
- Width = 1095
- End
- End
- Begin VB.Frame Frame10
- Caption = "Polygon"
- Height = 615
- Left = 1800
- TabIndex = 89
- Top = 4680
- Width = 1815
- Begin VB.CheckBox chkWinding
- Caption = "Winding"
- Height = 255
- Left = 120
- TabIndex = 90
- Top = 240
- Width = 975
- End
- End
- Begin VB.Frame Frame9
- Caption = "Rectangle Ellipse"
- Height = 1095
- Left = 120
- TabIndex = 82
- Top = 1080
- Width = 1575
- Begin VB.TextBox txtEllipseHeight
- Height = 285
- Left = 240
- TabIndex = 85
- Text = "txtEllipseHeight"
- Top = 720
- Width = 615
- End
- Begin VB.TextBox txtEllipseWidth
- Height = 285
- Left = 240
- TabIndex = 83
- Text = "txtEllipseWidth"
- Top = 360
- Width = 615
- End
- Begin VB.Label Label36
- Caption = "Height"
- Height = 255
- Left = 960
- TabIndex = 86
- Top = 720
- Width = 495
- End
- Begin VB.Label Label35
- Caption = "Width"
- Height = 255
- Left = 960
- TabIndex = 84
- Top = 360
- Width = 495
- End
- End
- Begin VB.Frame Frame8
- Caption = "Start and End Points"
- Height = 975
- Left = 1800
- TabIndex = 64
- Top = 2280
- Width = 1815
- Begin VB.TextBox txtEndY
- Height = 285
- Left = 720
- TabIndex = 69
- Text = "txtEndY"
- Top = 600
- Width = 495
- End
- Begin VB.TextBox txtEndX
- Height = 285
- Left = 120
- TabIndex = 68
- Text = "txtEndX"
- Top = 600
- Width = 495
- End
- Begin VB.TextBox txtStrY
- Height = 285
- Left = 720
- TabIndex = 66
- Text = "txtStrY"
- Top = 240
- Width = 495
- End
- Begin VB.TextBox txtStrX
- Height = 285
- Left = 120
- TabIndex = 65
- Text = "txtStrX"
- Top = 240
- Width = 495
- End
- Begin VB.Label Label28
- Caption = "End"
- Height = 255
- Left = 1320
- TabIndex = 70
- Top = 600
- Width = 375
- End
- Begin VB.Label Label27
- Caption = "Start"
- Height = 255
- Left = 1320
- TabIndex = 67
- Top = 240
- Width = 375
- End
- End
- Begin VB.TextBox txtIS
- Height = 285
- Left = 120
- TabIndex = 63
- Text = "txtIS"
- Top = 5760
- Width = 975
- End
- Begin VB.TextBox txtCD
- Height = 285
- Left = 120
- TabIndex = 61
- Text = "txtCD"
- Top = 5400
- Width = 495
- End
- Begin VB.Frame Frame7
- Caption = "Font"
- Height = 3135
- Left = 3720
- TabIndex = 59
- Top = 0
- Width = 1935
- Begin VB.CheckBox chkFontUnderline
- Caption = "Underline"
- Enabled = 0 'False
- Height = 255
- Left = 120
- TabIndex = 81
- Top = 2640
- Width = 1335
- End
- Begin VB.CheckBox chkFontStrikethru
- Caption = "Strikethrough"
- Enabled = 0 'False
- Height = 255
- Left = 120
- TabIndex = 80
- Top = 2280
- Width = 1335
- End
- Begin VB.CheckBox chkFontItalic
- Caption = "Italic"
- Enabled = 0 'False
- Height = 255
- Left = 120
- TabIndex = 79
- Top = 1920
- Width = 1095
- End
- Begin VB.CheckBox chkFontBold
- Caption = "Bold"
- Enabled = 0 'False
- Height = 255
- Left = 120
- TabIndex = 78
- Top = 1560
- Width = 735
- End
- Begin VB.TextBox txtFontSize
- Enabled = 0 'False
- Height = 285
- Left = 600
- TabIndex = 76
- Text = "txtFontSize"
- Top = 1080
- Width = 495
- End
- Begin VB.TextBox txtFontName
- Enabled = 0 'False
- Height = 285
- Left = 600
- TabIndex = 74
- Text = "txtFontName"
- Top = 720
- Width = 1215
- End
- Begin VB.CommandButton cmdFont
- Caption = "&Set Font"
- Height = 375
- Left = 120
- TabIndex = 60
- Top = 240
- Width = 1695
- End
- Begin VB.Label Label31
- Caption = "Size"
- Height = 255
- Left = 120
- TabIndex = 77
- Top = 1080
- Width = 375
- End
- Begin VB.Label Label29
- Caption = "Name"
- Height = 255
- Left = 120
- TabIndex = 75
- Top = 720
- Width = 495
- End
- End
- Begin VB.Frame Frame6
- Caption = "Fill Properties"
- Height = 1215
- Left = 1800
- TabIndex = 55
- Top = 3360
- Width = 1815
- Begin VB.CheckBox chkFT
- Caption = "FillTransparent"
- Height = 255
- Left = 120
- TabIndex = 58
- Top = 840
- Width = 1335
- End
- Begin VB.ComboBox cmbFS
- Height = 315
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 56
- Top = 480
- Width = 1575
- End
- Begin VB.Label Label23
- Caption = "FillStyle"
- Height = 255
- Left = 120
- TabIndex = 57
- Top = 240
- Width = 615
- End
- End
- Begin VB.Frame Frame5
- Caption = "Draw Properties"
- Height = 2055
- Left = 3720
- TabIndex = 48
- Top = 3240
- Width = 1935
- Begin VB.TextBox txtDW
- Height = 285
- Left = 1080
- TabIndex = 53
- Text = "txtDW"
- Top = 1560
- Width = 735
- End
- Begin VB.ComboBox cmbDS
- Height = 315
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 51
- Top = 1080
- Width = 1695
- End
- Begin VB.ComboBox cmbDA
- Height = 315
- Left = 120
- Style = 2 'Dropdown List
- TabIndex = 49
- Top = 480
- Width = 1695
- End
- Begin VB.Label Label22
- Caption = "DrawWidth"
- Height = 255
- Left = 120
- TabIndex = 54
- Top = 1560
- Width = 855
- End
- Begin VB.Label Label21
- Caption = "DrawStyle"
- Height = 255
- Left = 120
- TabIndex = 52
- Top = 840
- Width = 735
- End
- Begin VB.Label Label20
- Caption = "DrawArrows"
- Height = 255
- Left = 120
- TabIndex = 50
- Top = 240
- Width = 855
- End
- End
- Begin VB.Frame Frame3
- Caption = "Destination"
- Height = 975
- Left = 120
- TabIndex = 23
- Top = 0
- Width = 1575
- Begin VB.OptionButton optWND
- Caption = "to Window"
- Height = 255
- Left = 120
- TabIndex = 25
- Top = 600
- Width = 1095
- End
- Begin VB.OptionButton optDIB
- Caption = "to DIB"
- Height = 255
- Left = 120
- TabIndex = 24
- Top = 240
- Width = 1095
- End
- End
- Begin VB.Frame Frame2
- Caption = "Lines"
- Height = 2175
- Left = 1800
- TabIndex = 9
- Top = 0
- Width = 1815
- Begin VB.TextBox txtLY5
- Height = 285
- Left = 840
- TabIndex = 92
- Text = "txtLY5"
- Top = 1800
- Width = 615
- End
- Begin VB.TextBox txtLX5
- Height = 285
- Left = 120
- TabIndex = 91
- Text = "txtLX5"
- Top = 1800
- Width = 615
- End
- Begin VB.TextBox txtLY2
- Height = 285
- Left = 840
- TabIndex = 88
- Text = "txtLY2"
- Top = 720
- Width = 615
- End
- Begin VB.TextBox txtLY4
- Height = 285
- Left = 840
- TabIndex = 19
- Text = "txtLY4"
- Top = 1440
- Width = 615
- End
- Begin VB.TextBox txtLX4
- Height = 285
- Left = 120
- TabIndex = 18
- Text = "txtLX4"
- Top = 1440
- Width = 615
- End
- Begin VB.TextBox txtLY3
- Height = 285
- Left = 840
- TabIndex = 17
- Text = "txtLY3"
- Top = 1080
- Width = 615
- End
- Begin VB.TextBox txtLX3
- Height = 285
- Left = 120
- TabIndex = 16
- Text = "txtLX3"
- Top = 1080
- Width = 615
- End
- Begin VB.TextBox txtLX1
- Height = 285
- Left = 120
- TabIndex = 15
- Text = "txtLX1"
- Top = 360
- Width = 615
- End
- Begin VB.TextBox txtLX2
- Height = 285
- Left = 120
- TabIndex = 14
- Text = "txtLX2"
- Top = 720
- Width = 615
- End
- Begin VB.TextBox txtLY1
- Height = 285
- Left = 840
- TabIndex = 12
- Text = "txtLY1"
- Top = 360
- Width = 615
- End
- Begin VB.Label Label26
- Caption = "5"
- Height = 255
- Left = 1560
- TabIndex = 93
- Top = 1800
- Width = 135
- End
- Begin VB.Label Label16
- Caption = "4"
- Height = 255
- Left = 1560
- TabIndex = 22
- Top = 1440
- Width = 135
- End
- Begin VB.Label Label15
- Caption = "3"
- Height = 255
- Left = 1560
- TabIndex = 21
- Top = 1080
- Width = 135
- End
- Begin VB.Label Label14
- Caption = "2"
- Height = 255
- Left = 1560
- TabIndex = 20
- Top = 720
- Width = 135
- End
- Begin VB.Label Label13
- Caption = "1"
- Height = 255
- Left = 1560
- TabIndex = 13
- Top = 360
- Width = 135
- End
- Begin VB.Label Label12
- Alignment = 2 'Center
- Caption = "Y"
- Height = 255
- Left = 855
- TabIndex = 11
- Top = 180
- Width = 615
- End
- Begin VB.Label Label4
- Alignment = 2 'Center
- Caption = "X"
- Height = 255
- Left = 105
- TabIndex = 10
- Top = 180
- Width = 615
- End
- End
- Begin VB.Label Label37
- Caption = "Image Width, Height"
- Height = 255
- Left = 1200
- TabIndex = 87
- Top = 5760
- Width = 1815
- End
- Begin VB.Label Label25
- Caption = "Color Depth"
- Height = 255
- Left = 720
- TabIndex = 62
- Top = 5400
- Width = 855
- End
- Begin MSComDlg.CommonDialog comDialog
- Left = 4560
- Top = 120
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- CancelError = -1 'True
- DialogTitle = "Set Foreground Color"
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuLoad
- Caption = "&Load Image..."
- End
- Begin VB.Menu mnuFileOpenWhite8
- Caption = "Load &8 bit White"
- End
- Begin VB.Menu mnuFileOpenWhite24
- Caption = "Load &24 bit White"
- End
- Begin VB.Menu mnuFileOpenRGB8
- Caption = "Load 8 bit &RGB"
- End
- Begin VB.Menu mnuFileOpenRGB24
- 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"
- Shortcut = ^X
- End
- End
- Begin VB.Menu mnuDraw
- Caption = "&Draw"
- Begin VB.Menu mnuDrawArc
- Caption = "&Arc"
- End
- Begin VB.Menu mnuDrawChord
- Caption = "&Chord"
- End
- Begin VB.Menu mnuDrawPie
- Caption = "&Pie"
- End
- Begin VB.Menu mnuDrawPolygon
- Caption = "P&olygon"
- End
- Begin VB.Menu mnuDrawPolyLine
- Caption = "Po&lyLine"
- End
- Begin VB.Menu mnuDrawRect
- Caption = "&Rect"
- End
- Begin VB.Menu mnuDrawRoundRect
- Caption = "Ro&undRect"
- End
- Begin VB.Menu mnuSpacer2
- Caption = "-"
- End
- Begin VB.Menu mnuDrawText
- Caption = "&TextDraw"
- End
- Begin VB.Menu mnuDrawTextSize
- Caption = "Text&Size"
- End
- End
- Begin VB.Menu mnuUpdate
- Caption = "&Update"
- Begin VB.Menu mnuUpdateRefreshImage
- Caption = "&Refresh Image"
- End
- Begin VB.Menu mnuUpdateReloadImage
- Caption = "R&eload Image"
- End
- End
- Attribute VB_Name = "Draw"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim sCurrentFile As String
- Sub SetSelection()
- frmPicbuf!picbuf1.SelectLeft = CInt(Draw!txtSL.Text)
- frmPicbuf!picbuf1.SelectTop = CInt(Draw!txtST.Text)
- frmPicbuf!picbuf1.SelectWidth = CInt(Draw!txtSW.Text)
- frmPicbuf!picbuf1.SelectHeight = CInt(Draw!txtSH.Text)
- End Sub
- Private Sub cmdBC_Click()
- frmPicbuf.picbuf1.BackColor = GetColor(comDialog)
- txtBCRed.Text = getRed(frmPicbuf.picbuf1.BackColor)
- txtBCGreen.Text = getGreen(frmPicbuf.picbuf1.BackColor)
- txtBCBlue.Text = GetBlue(frmPicbuf.picbuf1.BackColor)
- pictBC.BackColor = frmPicbuf.picbuf1.BackColor
- End Sub
- Private Sub cmdFC_Click()
- frmPicbuf.picbuf1.ForeColor = GetColor(comDialog)
- txtFCRed.Text = getRed(frmPicbuf.picbuf1.ForeColor)
- txtFCGreen.Text = getGreen(frmPicbuf.picbuf1.ForeColor)
- txtFCBlue.Text = GetBlue(frmPicbuf.picbuf1.ForeColor)
- pictFC.BackColor = frmPicbuf.picbuf1.ForeColor
- End Sub
- Private Sub cmdFillC_Click()
- frmPicbuf.picbuf1.FillColor = GetColor(comDialog)
- txtFillCRed.Text = getRed(frmPicbuf.picbuf1.FillColor)
- txtFillCGreen.Text = getGreen(frmPicbuf.picbuf1.FillColor)
- txtFillCBlue.Text = GetBlue(frmPicbuf.picbuf1.FillColor)
- pictFillC.BackColor = frmPicbuf.picbuf1.FillColor
- End Sub
- Private Sub cmdFont_Click()
- GetFont frmPicbuf.picbuf1, comDialog
- ' update boxes
- txtFontName.Text = frmPicbuf.picbuf1.Font.Name
- txtFontSize.Text = Str$(frmPicbuf.picbuf1.Font.Size)
- ' font bold
- If frmPicbuf.picbuf1.Font.Bold = True Then
- chkFontBold.value = 1
- Else
- chkFontBold.value = 0
- End If
- ' font italic
- If frmPicbuf.picbuf1.Font.Italic = True Then
- chkFontItalic.value = 1
- Else
- chkFontItalic.value = 0
- End If
- ' font strike through
- If frmPicbuf.picbuf1.Font.Strikethrough = True Then
- chkFontStrikethru.value = 1
- Else
- chkFontStrikethru.value = 0
- End If
- ' font underline
- If frmPicbuf.picbuf1.Font.Underline = True Then
- chkFontUnderline.value = 1
- Else
- chkFontUnderline.value = 0
- End If
- End Sub
- Private Sub Form_Load()
- frmPicbuf.Show
- ' setup data
- g_nDrawLimit = 200
- ' load the image
- txtCD.Text = frmPicbuf.picbuf1.ColorDepth
- txtIS.Text = frmPicbuf.picbuf1.Xresolution & "," & frmPicbuf.picbuf1.Yresolution
- ' Select Properties
- txtSL.Text = "50"
- txtST.Text = "50"
- txtSW.Text = "100"
- txtSH.Text = "100"
- ' Rectangle Ellipse
- txtEllipseWidth.Text = "10"
- txtEllipseHeight.Text = "10"
- ' Destination
- optDIB.value = True
- ' DrawArrows
- InitcmbDrawArrows cmbDA
- ' DrawStyle
- InitcmbDrawStyle cmbDS
- ' DrawWidth
- txtDW.Text = "1"
- ' FillStyle
- InitcmbFillStyle cmbFS
- ' Text Alignment
- InitcmbTextAlignment cmbTA
- ' Lines
- txtLX1.Text = "100"
- txtLY1.Text = "10"
- txtLX2.Text = "66"
- txtLY2.Text = "190"
- txtLX3.Text = "190"
- txtLY3.Text = "66"
- txtLX4.Text = "10"
- txtLY4.Text = "66"
- txtLX5.Text = "132"
- txtLY5.Text = "190"
- ' Selection
- SetSelection
- ' Start & End
- txtStrX.Text = "50"
- txtStrY.Text = "150"
- txtEndX.Text = "150"
- txtEndY.Text = "50"
- 'Font
- frmPicbuf.picbuf1.Font.Name = "Arial"
- txtFontName.Text = "Arial"
- frmPicbuf.picbuf1.Font.Size = 12
- txtFontSize.Text = Str$(12)
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- End
- End Sub
- Private Sub mnuDrawArc_Click()
- ' get drawing setup
- SetupDrawing
- ' draw the Arc
- frmPicbuf.ZOrder
- frmPicbuf.picbuf1.Arc CInt(txtStrX), CInt(txtStrY), CInt(txtEndX), CInt(txtEndY), GetDestination
- End Sub
- Private Sub mnuDrawChord_Click()
- ' get drawing setup
- SetupDrawing
- ' draw the Chord
- frmPicbuf.picbuf1.Chord CInt(txtStrX), CInt(txtStrY), CInt(txtEndX), CInt(txtEndY), GetDestination
- End Sub
- Private Sub mnuDrawPie_Click()
- ' get drawing setup
- SetupDrawing
- ' draw the Pie
- frmPicbuf.picbuf1.Pie CInt(txtStrX), CInt(txtStrY), CInt(txtEndX), CInt(txtEndY), GetDestination
- End Sub
- Private Sub mnuDrawPolygon_Click()
- ' get drawing setup
- SetupDrawing
- ' get lines
- Dim j As Integer
- j = SetLines
- If j < 3 Then
- MsgBox "Not enough points"
- Exit Sub
- End If
- ' set winding
- Dim i As Integer
- If chkWinding = 1 Then
- i = 1
- Else
- i = 0
- End If
- ' draw the Polygon
- frmPicbuf.picbuf1.Polygon g_Lines(1), j, i, GetDestination
- End Sub
- Private Sub mnuDrawPolyLine_Click()
- ' get drawing setup
- SetupDrawing
- ' get lines
- Dim j As Integer
- j = SetLines
- If j < 1 Then
- MsgBox "No Lines to Draw"
- Exit Sub
- End If
-
- ' draw the Polygon
- frmPicbuf.picbuf1.PolyLine g_Lines(1), j, GetDestination
- End Sub
- Private Sub mnuDrawRect_Click()
- ' get drawing setup
- SetupDrawing
- ' draw the Rect
- frmPicbuf.picbuf1.Rect GetDestination
- End Sub
- Private Sub mnuDrawRoundRect_Click()
- ' get drawing setup
- SetupDrawing
- ' draw the RoundRect
- frmPicbuf.picbuf1.RoundRect CInt(txtEllipseWidth), CInt(txtEllipseHeight), GetDestination
- End Sub
- Private Sub mnuDrawText_Click()
- ' set selection properties
- SetSelection
- ' setup the text
- SetText
- ' draw the text
- frmPicbuf.picbuf1.TextDraw GetDestination
- End Sub
- Private Sub mnuDrawTextSize_Click()
- ' set selection properties
- SetSelection
- ' setup the text
- SetText
- Dim nHigh As Integer
- Dim nWide As Integer
- nHigh = frmPicbuf.picbuf1.TextHigh
- nWide = frmPicbuf.picbuf1.TextWide
- MsgBox "Text is " & Str$(nHigh) & "," & Str$(nWide) & " pixels (high,wide)"
- End Sub
- Private Sub mnuExit_Click()
- ExitProgram
- End Sub
- Private Sub mnuFileOpenRGB24_Click()
- InitPicbuf frmPicbuf.picbuf1, False, "Rgb24.bmp"
- End Sub
- Private Sub mnuFileOpenRGB8_Click()
- InitPicbuf frmPicbuf.picbuf1, False, "Rgb8.bmp"
- End Sub
- Private Sub mnuFileOpenWhite24_Click()
- InitPicbuf frmPicbuf.picbuf1, False, "White24.bmp"
- End Sub
- Private Sub mnuFileOpenWhite8_Click()
- InitPicbuf frmPicbuf.picbuf1, False, "White8.bmp"
- End Sub
- Private Sub mnuLoad_Click()
- LoadImage frmPicbuf.picbuf1, comDialog
- End Sub
- Private Sub mnuSave_Click()
- SaveImage frmPicbuf.picbuf1, comDialog
- End Sub
- Private Sub mnuUpdateRefreshImage_Click()
- frmPicbuf.picbuf1.Refresh
- End Sub
- Private Sub mnuUpdateReloadImage_Click()
- frmPicbuf.picbuf1.Load
- End Sub
- Private Sub txtFCBlue_Change()
- ' check range value
- Dim value As Integer
- value = CInt(txtFCBlue.Text)
- If value < 0 Or value > 255 Then
- MsgBox "Bad BLUE Forecolor"
- txtFCBlue.Text = "0"
- End If
- End Sub
- Private Sub txtFCGreen_Change()
- ' check range value
- Dim value As Integer
- value = CInt(txtFCGreen.Text)
- If value < 0 Or value > 255 Then
- MsgBox "Bad GREEN Forecolor"
- txtFCGreen.Text = "0"
- End If
- End Sub
- Private Sub txtFCRed_Change()
- ' check range value
- Dim value As Integer
- value = CInt(txtFCRed.Text)
- If value < 0 Or value > 255 Then
- MsgBox "Bad RED Forecolor"
- txtFCRed.Text = "0"
- End If
- End Sub
-