Q:

Is there a way to invert colors on a randomize position?

I want to take the colors on my screen and invert them, then print them back to the screen using the BitBlt function, as I know the function takes a picture, copies it and pastes it
It back to the screen.
Basically what I want is to invert the colors with DSTINVERT, what it does it take the colors on the screen, invert them and print back to the screen.
So I used that, and I wanted to do the random position on the screen, I took the screen pixels with the GetSystemMetrics function and did a random print on the screen.
But it doesn't work for me, doesn't print anything and doesn't do anything, if I put my randomness resolution (1920x1080), it works and prints randomly, but I want the program to work as well on all screens.
Would appreciate help.
#include <iostream>
#include <Windows.h>
#include <time.h>

using namespace std;

int main()
{
    srand(time(0));
    HDC desktop = GetDC(GetDesktopWindow());

    int width = GetSystemMetrics(SM_CXSCREEN);
    int height = GetSystemMetrics(SM_CYSCREEN);

    for (int i = 0; i < 1000; i++) {

        // Position on the screen
        int x = rand() % width;
        int y = rand() % height;

        Sleep(3000);
        BitBlt(desktop, width, height, 250, 250, desktop, width, height, DSTINVERT);
    }
    return 0;
}

And I would also love if someone explain the two parameters (7, 8) because I did not understand so much about doing so I did the same randomness.

A:

Sorry! my fault.
I have used the width and height as parameters.
I was need to use the x and y.
My program is now working well.
But i still want please explain about the parameters (8, 7). Thanks!
#include <iostream>
#include <Windows.h>
#include <time.h>

using namespace std;

int main()
{
    srand(time(0));
    HDC desktop = GetDC(GetDesktopWindow());

    int width = GetSystemMetrics(SM_CXSCREEN);
    int height = GetSystemMetrics(SM_CYSCREEN);

    for (int i = 0; i < 1000; i++) {

        // Size 
        int size1 = rand() % 500;
        int size2 = rand() % 500;

        // Position on the screen
        int x = rand() % width;
        int y = rand() % height;

        Sleep(3000);
        BitBlt(desktop, x, y, size1, size2, desktop, x, y, DSTINVERT);
    }
    return 0;
}

