其他提示

我没有一个样品,但在Windows画笔一般使用一些提示。

CreateHatchBrush()返回句柄。您需要使用该句柄,使该刷当前刷在你使用渲染设备上下文。调用设备上下文的SetObject功能(普通的Windows GDI调用版本):

HDC myDC = GetDC (hWnd); //pass your window handle here or NULL for the entire screen  
HBRUSH hatchBrush = CreateHatchBrush (HS_DIAGCROSS, RGB (255,128,0));  
HBRUSH oldBrush = SelectObject (myDC, hatchBrush);  
//draw something here  
SelectObject (myDC, oldBrush); //restore previous brush  
ReleaseDC (myDC);
scroll top