home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples5 / ch08 / ex8b.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-16  |  5.3 KB  |  166 lines

  1. VERSION 5.00
  2. Begin VB.Form frmex8B 
  3.    Caption         =   "Additional Examples"
  4.    ClientHeight    =   2865
  5.    ClientLeft      =   1845
  6.    ClientTop       =   1485
  7.    ClientWidth     =   6765
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   191
  11.    ScaleMode       =   3  'Pixel
  12.    ScaleWidth      =   451
  13.    Begin VB.CommandButton Command3 
  14.       Caption         =   "DrawState Complex"
  15.       Height          =   435
  16.       Left            =   4980
  17.       TabIndex        =   11
  18.       Top             =   1200
  19.       Width           =   1575
  20.    End
  21.    Begin VB.CommandButton Command2 
  22.       Caption         =   "DrawState Text"
  23.       Height          =   435
  24.       Left            =   4980
  25.       TabIndex        =   9
  26.       Top             =   720
  27.       Width           =   1575
  28.    End
  29.    Begin VB.CommandButton Command1 
  30.       Caption         =   "DrawState Bitmap"
  31.       Height          =   435
  32.       Left            =   4980
  33.       TabIndex        =   8
  34.       Top             =   240
  35.       Width           =   1575
  36.    End
  37.    Begin VB.Frame Frame1 
  38.       Caption         =   "Effect"
  39.       Height          =   2175
  40.       Left            =   2820
  41.       TabIndex        =   2
  42.       Top             =   120
  43.       Width           =   1995
  44.       Begin VB.CheckBox chkRight 
  45.          Caption         =   "Right"
  46.          Height          =   255
  47.          Left            =   180
  48.          TabIndex        =   7
  49.          Top             =   1800
  50.          Width           =   1515
  51.       End
  52.       Begin VB.OptionButton optEffect 
  53.          Caption         =   "Disabled"
  54.          Height          =   255
  55.          Index           =   3
  56.          Left            =   180
  57.          TabIndex        =   6
  58.          Top             =   1380
  59.          Width           =   1695
  60.       End
  61.       Begin VB.OptionButton optEffect 
  62.          Caption         =   "Mono"
  63.          Height          =   255
  64.          Index           =   2
  65.          Left            =   180
  66.          TabIndex        =   5
  67.          Top             =   1020
  68.          Width           =   1695
  69.       End
  70.       Begin VB.OptionButton optEffect 
  71.          Caption         =   "Union"
  72.          Height          =   255
  73.          Index           =   1
  74.          Left            =   180
  75.          TabIndex        =   4
  76.          Top             =   660
  77.          Width           =   1695
  78.       End
  79.       Begin VB.OptionButton optEffect 
  80.          Caption         =   "Normal"
  81.          Height          =   255
  82.          Index           =   0
  83.          Left            =   180
  84.          TabIndex        =   3
  85.          Top             =   300
  86.          Value           =   -1  'True
  87.          Width           =   1695
  88.       End
  89.    End
  90.    Begin VB.PictureBox Picture2 
  91.       BeginProperty Font 
  92.          Name            =   "Swis721 Cn BT"
  93.          Size            =   15.75
  94.          Charset         =   0
  95.          Weight          =   700
  96.          Underline       =   0   'False
  97.          Italic          =   -1  'True
  98.          Strikethrough   =   0   'False
  99.       EndProperty
  100.       Height          =   1155
  101.       Left            =   60
  102.       ScaleHeight     =   75
  103.       ScaleMode       =   3  'Pixel
  104.       ScaleWidth      =   171
  105.       TabIndex        =   1
  106.       Top             =   1320
  107.       Width           =   2595
  108.    End
  109.    Begin VB.PictureBox Picture1 
  110.       Height          =   1095
  111.       Left            =   60
  112.       Picture         =   "EX8B.frx":0000
  113.       ScaleHeight     =   1065
  114.       ScaleWidth      =   2565
  115.       TabIndex        =   0
  116.       Top             =   120
  117.       Width           =   2595
  118.    End
  119.    Begin VB.Label Label1 
  120.       Caption         =   "Note: All combinations are using a red brush."
  121.       Height          =   255
  122.       Left            =   60
  123.       TabIndex        =   10
  124.       Top             =   2520
  125.       Width           =   3555
  126.    End
  127. Attribute VB_Name = "frmex8B"
  128. Attribute VB_GlobalNameSpace = False
  129. Attribute VB_Creatable = False
  130. Attribute VB_PredeclaredId = True
  131. Attribute VB_Exposed = False
  132. ' Ex8B example
  133. ' Copyright (c) 1996-1997 by Desaware Inc. All Rights Reserved
  134. Option Explicit
  135. Private Sub Command1_Click()
  136.     Dim di&
  137.     Dim hbr&
  138.     Picture2.Cls
  139.     hbr& = CreateSolidBrush(RGB(255, 0, 0))
  140.     di = DrawState(Picture2.hdc, hbr&, 0, Picture1.Picture, 0, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, DST_BITMAP Or GetEffect())
  141. End Sub
  142. Public Function GetEffect&()
  143.     Dim x%
  144.     Dim eff&
  145.     If optEffect(0).Value <> 0 Then eff = DSS_NORMAL
  146.     If optEffect(1).Value <> 0 Then eff = DSS_UNION
  147.     If optEffect(2).Value <> 0 Then eff = DSS_MONO
  148.     If optEffect(3).Value <> 0 Then eff = DSS_DISABLED
  149.     If chkRight.Value <> 0 Then eff = eff Or DSS_RIGHT
  150.     GetEffect = eff
  151. End Function
  152. Private Sub Command2_Click()
  153.     Dim di&
  154.     Dim hbr&
  155.     Picture2.Cls
  156.     hbr& = CreateSolidBrush(RGB(255, 0, 0))
  157.     di = DrawStateByString(Picture2.hdc, hbr&, 0, "A String", 8, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, DST_TEXT Or GetEffect())
  158. End Sub
  159. Private Sub Command3_Click()
  160.     Dim di&
  161.     Dim hbr&
  162.     Picture2.Cls
  163.     hbr& = CreateSolidBrush(RGB(255, 0, 0))
  164.     di = DrawState(Picture2.hdc, hbr&, AddressOf Callback1_cbxLLLLL, 195, 42, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, DST_COMPLEX Or GetEffect())
  165. End Sub
  166.