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
9
votes
2 answers

BitBlt performance with Aero enabled

I'd like to get more performance out of BitBlt for capturing the screen. When Aero remains enabled, capturing only a 400x400 pixel area of the screen reduces capture time from an average of 50ms (full 1920x1200) to about 33ms (for 400x400) on my…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
9
votes
2 answers

Get Pixel color fastest way?

I'm trying to make an auto-cliker for an windows app. It works well, but it's incredibly slow! I'm currently using the method "getPixel" which reloads an array everytime it's called. Here is my current code: hdc = GetDC(HWND_DESKTOP); bx =…
Manitoba
  • 8,522
  • 11
  • 60
  • 122
8
votes
2 answers

Are the GDI functions BitBlt and StretchBlt hardware accelerated in Win32?

I can't seem to get a definite answer to this via searching. Are the Win32 blitting operations hardware accelerated (GDI, not GDI+). I don't know how these functions interface with the graphics driver. Is there any function call to verify this…
oldSkool
  • 1,212
  • 5
  • 14
  • 29
8
votes
1 answer

Detect if a window is using hardware-accelerated graphic context

I'm using BitBlt winapi function to take a screenshot of a given window, even if the window is partially overlapped. I have everything working fine already, except that, on Windows 10, for some windows (like the Edge browser) the screenshot turns…
Tim
  • 81
  • 3
8
votes
2 answers

Converting from HBITMAP to Jpeg or Png in C++

Does anyone know how I can use an HBITMAP variable to write a png or jpeg file? I first looked into doing this with GDI+ but it gives me errors telling me min/max haven't been defined (defining them just brings more problems), I then looked into…
Mikey
  • 2,942
  • 33
  • 37
7
votes
1 answer

Qt: Alternative to BitBlt in Qt5 Windows

I am currently porting an open-source solution (Albatross ATM solution http://www.albatross.aero/) from Qt3 to Qt5. Albatross is an air traffic viewer which requires very good performances. There are various issues that I have been able to manage…
Robert Jones
  • 587
  • 7
  • 25
6
votes
0 answers

In VMWare, BitBlt() sometimes takes a very long time for ONE pixel (400 ms or more)

Any ideas/workarounds on how to improve my BitBlt() reliability when running it in VMware? I have a timer that measures the time spent: SmartTimer debugTimer = SmartTimer(); debugTimer.restart(); int ms1 = debugTimer.elapsedTimeMs(); POINT origin =…
pete
  • 1,878
  • 2
  • 23
  • 43
6
votes
3 answers

Copy Graphics content to bitmap

I try to copy the contents of a graphics object to a bitmap. I'm using this code public static class GraphicsBitmapConverter { [DllImport("gdi32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] private static extern…
MBulli
  • 1,659
  • 2
  • 24
  • 36
6
votes
1 answer

Is it possible to BitBlt directly from a GDI+ bitmap?

Is it possible to use BitBlt to copy directly out of a GDI+ bitmap without using GetHBitmap? GetHBitmap is slow because it makes a new copy of the whole image, in addition to and slower than the BitBlt copy, and the given HBITMAP must be disposed. …
jnm2
  • 7,960
  • 5
  • 61
  • 99
6
votes
0 answers

BitBlt not capturing windows in Hardware accelerated mode

I'm currently working on capturing window snapshots using GDI32.dll though I'm having an issue with Hardware Accelerated Windows that I was wondering if there was a way to circumvent. I found this amazing bit of code here: public static Image…
Ozzadar
  • 518
  • 1
  • 3
  • 10
6
votes
2 answers

How to make tesseract-ocr read from coordinates on a screen?

I have been trying to look for an example of how to make a class/function that would attempt to read text from a the screen at specified coordinates. Something simple that would use bitblt to capture the specified section of the screen and run…
user2180519
6
votes
2 answers

Capturing a program window with BitBlt always returns the same image

I wrote the following code (C++ Win32) to capture a game window screen and get pixel color array from the image. Function autoB() does the job. Then I draw the result array into my window to visually check what I got. The problem is that this…
user1481126
5
votes
1 answer

How to speed up BitBlt to capture screen with aero?

I use following code to capture the screen with GDI functions: // Prologue: int iScreenWidth = GetSystemMetrics(SM_CXSCREEN); int iScreenHeight = GetSystemMetrics(SM_CYSCREEN); HDC hScreenDC = GetDC(0); HDC hCaptureDC =…
TX_
  • 51
  • 1
  • 2
5
votes
2 answers

PrintWindow and BitBlt of hidden windows

My program is taking screenshots of other application windows to automate some tasks on them. Those windows can be hidden offscreen or obscured by other windows from time to time. To reduce clutter, I have removed any error checking from the code…
Johannes Stricker
  • 1,701
  • 13
  • 23
5
votes
2 answers

BitBlt in Qt4?

What is the recommended method of copying one QImage into another at a particular position in Qt4? QImage::bitblt was removed in Qt4. Does the QImage now need to be converted to a PixMap and back?
user408209
  • 119
  • 2
  • 3
1
2 3
10 11