Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleUse the API Pie function to draw pie slices
Keywordspie, pie slice
CategoriesAPI, Graphics
 
The only interesting thing here is to note that Visual Basic's normal drawing properties (DrawWidth, ForeColor, etc.) work with the Pie function (and most API drawing functions).
 
Private Declare Function Pie Lib "gdi32" (ByVal hdc As _
    Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As _
    Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As _
    Long, ByVal X4 As Long, ByVal Y4 As Long) As Long

Private Sub Form_Load()
    AutoRedraw = True
    ScaleMode = vbPixels

    DrawWidth = 3
    ForeColor = vbRed
    FillColor = vbBlue
    FillStyle = vbDiagonalCross
    Pie hdc, 10, 10, ScaleWidth, ScaleHeight, _
        50, 0, 100, 100
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated