pythonscreenshotpywin32bitbltwin32con

What is the purpose of 'win32con.SRCCOPY'?


In the code of answer of this question, there is a line cDC.BitBlt((0,0),(w, h) , dcObj, (0,0), win32con.SRCCOPY). Here what is the purpose of win32con.SRCCOPY? I have looked for documentation everywhere, but I can't find anything.

From here I take that it is a raster operation code, but that is suppose to be an integer. I am not sure if the documentation of BitBlt is even correct as the destination is not defined in the code, (code works fine).

I assume that SRCCOPY stands for source copy.


Solution

  • It's a symbolic integer constant defined in the win32con module that specifies what raster operation (rop) to perform when calling the win32gui.BitBlt() function.

    The official BitBlt function (wingdi.h) - Win32 apps | Microsoft Docs describes it and long list of other possible argument values that can be given.

    The definition for it is:

    SRCCOPY — Copies the source rectangle directly to the destination rectangle.

    Here's so Python Examples of using win32con.SRCCOPY.