Questions tagged [bitblt]

BitBlt WinAPI function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

BitBlt is a Windows API function, which performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.

A raster operation code is also passed to the BitBlt function, which affects how the source DC and destination DC are merged together. For example, bits can be ANDed, ORed, XORed, etc.. together for different effects.

162 questions
0
votes
2 answers

win32 bitmaps flashing when more than one sprite on screen

I've been using the win32 api to make a game with sprites. For some reason when I have more than one sprite on screen they flash occasionally as if they are disappearing and returning. When there is only one sprite on screen it displays correctly. I…
Dave
  • 161
  • 1
  • 4
  • 18
0
votes
1 answer

python win32ui.error: BitBlt failed & CreateCompatibleBitmap failed in multithreading

I'm here to ask for help on a recent problem I encountered with my program.... I am getting this error when I try to use BitBlt and CreateCompatibleBitmap: win32ui.error: BitBlt failed & CreateCompatibleBitmap, It's worth mentioning that this…
0
votes
1 answer

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…
user541396
  • 163
  • 1
  • 9
0
votes
0 answers

BitBlt not getting its 'aim' consistant

Windows 11 I have three monitors in front of me. The one on the left has negative screen x coordinates, the centre one starts from zero and the one on the right, a 4K, carries on where the centre one left off. All nice and usual. So I…
nigelh
  • 1
  • 1
0
votes
1 answer

MFC Dialogue based application

Good day, I am trying to add a bitmap image to my dialogue-based application using MFC ( VSTUDIO 2019 ). I wish to position my image at the center of the application. How do I get the size of the current rectangle so that it can be given as an input…
Justin M
  • 29
  • 3
0
votes
2 answers

How OBS record hidden window?

I'm making a program to record a window that is obscured by another window via python and WIN32API library. Through many searches, I succeeded in capturing the hidden window through hwnd and BitBlt, but the execution time of my code is not stable. I…
dy.kim
  • 13
  • 4
0
votes
1 answer

Very unexpected behavior of C++ win32 BitBlt

I noticed when I try to run BitBlt, the resulting data buffer is unexpected in two ways: It is flipped along the y axis (the origin seems to be bottom left instead of top left) In each RGBA grouping, the R and B values seem to be switched. For the…
pete
  • 1,878
  • 2
  • 23
  • 43
0
votes
1 answer

CreateDCFromHandle select object TOP coordinate in Python

I need to capture a specific application window on Windows, even if it is not focused or in the foreground, WITHOUT the window's top header bar, which height I specify manually in 'application_window_topbar_size' variable to keep it…
D.Moore
  • 45
  • 1
  • 6
0
votes
1 answer

What context should I refer to so I am able to BitBlt on top of any application or window? Is there a "general" context which refer to display?

So I`m very new to win32ui, basically just starting. I was once using BitBlt wit python win32api module and as far as I remember to draw on top of display (so any application - if they are opened) I had to get specific context handle. But my memory…
Nikolai Savulkin
  • 697
  • 5
  • 12
0
votes
1 answer

Unexpected Bitmap Size Drawn by BitBlt and CreateBitmap

I managed to extract the raw bytes of the bitmap used by the cursor of another application. It should be a 32x32 pixel 32bit color bitmap i.e. (24bit RGB + 8bit alpha). There are 4096 bytes which exactly corresponds to 4bytes per pixel (32*32=1024…
JavaMan
  • 4,954
  • 4
  • 41
  • 69
0
votes
0 answers

PrintScreen and BitBlt causing screen flicker

I'm trying to take a screenshot of another window specified by a valid hwnd. The procedure works, however the window flickers when the screenshot is taken. The first function uses PrintScreen, the second BitBlt. Each is called from a routine that…
Scott Mooney
  • 167
  • 1
  • 1
  • 4
0
votes
0 answers

Resize image by adding extra black pixels at borders

I would like to resize an image(lower resolution to higher resolution) by adding black pixels at the borders. I have raw image data available in YUV420/RGB format. I want to add back pixels to this raw image data and change its resolution to desired…
Sudheer Kumar
  • 77
  • 1
  • 7
0
votes
1 answer

Win32 Duplicate, mirror, copy or draw window contents twice, with perfect frame synchronization. For stereo left-eye right-eye rendering

I have written a Win32 C++ program. I would like to duplicate the visual content of the left window every frame, so it appears at another location on the screen. (One rectangle on the left side of the screen, and an identical rectangle on the right…
robotcoder
  • 75
  • 1
  • 5
0
votes
2 answers

Control to draw in a window gdi

I have used Visual Basic 6 in the past (LOONG ago), and it had a control called PictureBox where you could just draw stuff to, get a device context if you wanted, etc. I'm now trying to find out how to have a similar "control" in pure GDI/WinApi (no…
stelonix
  • 716
  • 1
  • 5
  • 24
0
votes
0 answers

Capture hWnd with WindowDisplayAffinity = 1

How can i capture image from specific window with SetWindowDisplayAffinity = 1? I know OBS Studio with "Game Capture" resource and NVIDIA ShadowPlay can do this, but i don't know how. I already tried to capture the window image by BitBlt and…