PathToRegion

  HRGN PathToRegion(hdc)    
  HDC hdc;    

The PathToRegion function creates a region from a path.

Parameters

hdc

Identifies the device context of the path.

Return Value

Returns the handle to the resulting region if the call succeeds, 0 otherwise.

Comments

The DC must have an inactive path bracket, started by calling BeginPath and ended by calling EndPath. PathToRegion discards the path.

The current SetPolyFillMode value is used to create the region.

Errors

Use the GetLastError function to retrieve the error value, which may be one of the following:

ERROR_INVALID_MODE  
ERROR_INVALID_PARAMETER  
ERROR_NOT_ENOUGH_MEMORY  

See Also

SetPolyFillMode, BeginPath, EndPath