I'm trying to draw a structure in Windows GDI within a certain clip path to verify the functionalities of my printer driver. However, I would like to confirm about whether my client application test code would be functional since I have been encounterring some problems with the clip path that I would like to isolate between the client application and the driver.
This is my clip region drawing function.
Code:
void RectDraw(HDC *hdc)
{
BOOL success;
int nX = 150;
int nY = 150;
DWORD dwRadius = 100;
float xStartAngle = 60;
float xSweepAngle = 60;
HGDIOBJ hNewObj;
HBRUSH hBrush;
POINT points[] = {
{1700, 1700},
{2000, 2000},
{2562, 1503}
};
// set up the brush
hBrush = CreateSolidBrush(RGB(44, 25, 64));
// Begin Path
success = BeginPath(*hdc);
// Create a Path
success = Rectangle(*hdc, 150, 150, 200, 200);
success = EndPath(*hdc);
success = SelectClipPath(*hdc, RGN_AND);
}
The clip region drawing function is called before the pie path filling function, like as shown below:
Code:
RectDraw(&hDC);
PieDraw(&hDC); // has shown to work
The clipping path function is implemented roughly according to the documentation on Windows GDI in MSDN. Any comments would be muchly appreciated.