mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2025-05-10 08:40:41 +08:00
17 lines
429 B
C
17 lines
429 B
C
/*
|
|
* lock the dc and draw the scan line with random color.
|
|
*/
|
|
|
|
int i, width, height, pitch;
|
|
RECT rc = {0, 0, 200, 200};
|
|
int bpp = GetGDCapability (hdc, GDCAP_BPP);
|
|
Uint8* frame_buffer = LockDC (hdc, &rc, &width, &height, &pitch);
|
|
Uint8* row = frame_buffer;
|
|
|
|
for (i = 0; i < *height; i++) {
|
|
memset (row, rand ()%0x100, *width * bpp);
|
|
row += *pitch;
|
|
}
|
|
|
|
UnlockDC (hdc);
|