home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmex8B
- Caption = "Additional Examples"
- ClientHeight = 2865
- ClientLeft = 1845
- ClientTop = 1485
- ClientWidth = 6765
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 191
- ScaleMode = 3 'Pixel
- ScaleWidth = 451
- Begin VB.CommandButton Command3
- Caption = "DrawState Complex"
- Height = 435
- Left = 4980
- TabIndex = 11
- Top = 1200
- Width = 1575
- End
- Begin VB.CommandButton Command2
- Caption = "DrawState Text"
- Height = 435
- Left = 4980
- TabIndex = 9
- Top = 720
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "DrawState Bitmap"
- Height = 435
- Left = 4980
- TabIndex = 8
- Top = 240
- Width = 1575
- End
- Begin VB.Frame Frame1
- Caption = "Effect"
- Height = 2175
- Left = 2820
- TabIndex = 2
- Top = 120
- Width = 1995
- Begin VB.CheckBox chkRight
- Caption = "Right"
- Height = 255
- Left = 180
- TabIndex = 7
- Top = 1800
- Width = 1515
- End
- Begin VB.OptionButton optEffect
- Caption = "Disabled"
- Height = 255
- Index = 3
- Left = 180
- TabIndex = 6
- Top = 1380
- Width = 1695
- End
- Begin VB.OptionButton optEffect
- Caption = "Mono"
- Height = 255
- Index = 2
- Left = 180
- TabIndex = 5
- Top = 1020
- Width = 1695
- End
- Begin VB.OptionButton optEffect
- Caption = "Union"
- Height = 255
- Index = 1
- Left = 180
- TabIndex = 4
- Top = 660
- Width = 1695
- End
- Begin VB.OptionButton optEffect
- Caption = "Normal"
- Height = 255
- Index = 0
- Left = 180
- TabIndex = 3
- Top = 300
- Value = -1 'True
- Width = 1695
- End
- End
- Begin VB.PictureBox Picture2
- BeginProperty Font
- Name = "Swis721 Cn BT"
- Size = 15.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = -1 'True
- Strikethrough = 0 'False
- EndProperty
- Height = 1155
- Left = 60
- ScaleHeight = 75
- ScaleMode = 3 'Pixel
- ScaleWidth = 171
- TabIndex = 1
- Top = 1320
- Width = 2595
- End
- Begin VB.PictureBox Picture1
- Height = 1095
- Left = 60
- Picture = "EX8B.frx":0000
- ScaleHeight = 1065
- ScaleWidth = 2565
- TabIndex = 0
- Top = 120
- Width = 2595
- End
- Begin VB.Label Label1
- Caption = "Note: All combinations are using a red brush."
- Height = 255
- Left = 60
- TabIndex = 10
- Top = 2520
- Width = 3555
- End
- Attribute VB_Name = "frmex8B"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' Ex8B example
- ' Copyright (c) 1996-1997 by Desaware Inc. All Rights Reserved
- Option Explicit
- Private Sub Command1_Click()
- Dim di&
- Dim hbr&
- Picture2.Cls
- hbr& = CreateSolidBrush(RGB(255, 0, 0))
- di = DrawState(Picture2.hdc, hbr&, 0, Picture1.Picture, 0, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, DST_BITMAP Or GetEffect())
- End Sub
- Public Function GetEffect&()
- Dim x%
- Dim eff&
- If optEffect(0).Value <> 0 Then eff = DSS_NORMAL
- If optEffect(1).Value <> 0 Then eff = DSS_UNION
- If optEffect(2).Value <> 0 Then eff = DSS_MONO
- If optEffect(3).Value <> 0 Then eff = DSS_DISABLED
- If chkRight.Value <> 0 Then eff = eff Or DSS_RIGHT
- GetEffect = eff
- End Function
- Private Sub Command2_Click()
- Dim di&
- Dim hbr&
- Picture2.Cls
- hbr& = CreateSolidBrush(RGB(255, 0, 0))
- di = DrawStateByString(Picture2.hdc, hbr&, 0, "A String", 8, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, DST_TEXT Or GetEffect())
- End Sub
- Private Sub Command3_Click()
- Dim di&
- Dim hbr&
- Picture2.Cls
- hbr& = CreateSolidBrush(RGB(255, 0, 0))
- di = DrawState(Picture2.hdc, hbr&, AddressOf Callback1_cbxLLLLL, 195, 42, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, DST_COMPLEX Or GetEffect())
- End Sub
-