Jalaj P. Jha

Technical & Miscellaneous Ramblings

WinAPI : The Pie Function

with one comment

The Pie WinAPI function takes the same set of parameters as the Arc function, draws an arc similar to what it could have drawn with Arc function with exception that it also draws the radials from the center of the ellipse to the end points of the arc, thus drawing a pie-shaped area.

The first parameter that the function requires is the handle to the device context. The next four parameters are the X and Y co-ordinates of the Top-Left and Bottom-Right corners of the rectangle that bounds the ellipse. The next four parameters are the X and Y co-ordinates of the two points, the radials from the center of the ellipse to which intersects the ellipse to determine the end points of the arc.

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

pie.jpg

As with Chord function the Pie function does not use or set the current drawing point on the device context.

Written by Jalaj

February 20th, 2007 at 11:04 am

Posted in Visual Basic, WinAPI

Tagged with

One Response to 'WinAPI : The Pie Function'

Subscribe to comments with RSS or TrackBack to 'WinAPI : The Pie Function'.

  1. [...] WinAPI : The Pie Function [...]

Leave a Reply