def METHOD_NAME(self, handle):
    """
    Copy the bitmap contents to a device context.
    :param handle: Device context (HDC), cast to a Python integer, or an
                   HDC or HWND instance.  In PythonWin, you can use the
                   :py:meth:`CDC.GetHandleAttrib` to get a suitable handle.
    """
    if isinstance(handle, HWND):
        dc = self.image.getdc(handle)
        try:
            result = self.image.METHOD_NAME(dc)
        finally:
            self.image.releasedc(handle, dc)
    else:
        result = self.image.METHOD_NAME(handle)
    return result