Deletedc
This function deletes the specified device context (DC ).
Prototype:
Bool deletedc (HDCHDC);
Parameters:
HDC: handle of the device context.
Return Value:
If the call succeeds, a non-zero value is returned. If the call fails, zero is returned. Call getlasterror to obtain the extended error message.
Note:
If the handle of a device's context environment is calledGetdcThe application cannot delete the context of the device.ReleasedcFunction to release the device context.
Releasedc
Function releases the device context environment (DC) for use by other applications. The effect of the function is related to the device context type.
Prototype:
Int releasedc (hwndHwnd, HDCHDC);
Parameters:
Hwnd: the handle to the window in which the device context is to be released.
HDC: The handle pointing to the device context environment to be released.
Return Value:
The return value indicates whether the device context environment is released. If the device context environment is released successfully, the return value is 1. If the device context environment is not released successfully, the return value is 0.
Note:
Each callGetwindowdcAndGetdcAfter the function retrieves the context of a public device, the application must callReleasedcFunction to release the device context.
Applications cannot call the releasedc function to releaseCreatedc, createcopatibledcThe device context environment created by the function can only be usedDeletedcFunction.
Deleteobject
This function deletes a logic pen, paint brush, Font, bitmap, area, or palette, and releases all system resources related to the object. After the object is deleted, the specified handle becomes invalid.
Prototype:
Bool deleteobject (hgdiobj hobject );
Parameters:
Hobject: handle of the logic pen, paint brush, Font, bitmap, area, or palette.
Return Value:
A non-zero value is returned. If the specified handle is invalid or has been selected into the device context, the returned value is zero. Call getlasterror to obtain the extended error message.
Note:
Do not delete a painting object (such as a pen or paint brush) when it is selected as a device context. When a color palette paint brush is deleted, the bitmap associated with the paint brush is not deleted, and the paint must be deleted separately.
Deletedc releasedc deleteobject