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
5
votes
1 answer

How to increase performance over GDI's DrawImage(Unscaled)?

In my user control's paint handler I iterate over a collection of predefined Bitmap objects and draw them to the client area thusly: C# version: private void Control_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; foreach…
Paul Sasik
  • 79,492
  • 20
  • 149
  • 189
5
votes
1 answer

Detect game hack through screenshot analysis C#

I'm trying to write some code to detect a wallhack for a game. Basically, some hacks exist which create a windows aero transparent window, and they draw the hack onto this external window, so it can't be detected by taking a screenshot of the game…
DaManJ
  • 373
  • 2
  • 15
4
votes
1 answer

Screenshot captured using BitBlt in C# results a black image on Windows 10

Screenshot captured using BitBlt in c# resulted a black image on Windows 10. Please help me to resolve this. Screenshot is black image for Chrome (when hardware accelerated mode is on) and IE/Edge windows. Output image is black only for Edge, IE…
tbala
  • 43
  • 3
  • 9
4
votes
2 answers

MFC BitBlt and SetDIBits vs. SetBitmapBits

I have a bitmap stored as a BGRA array of bytes. This is the code I've been using to paint the bitmap: CDC *dispDC = new CDC(); dispDC->CreateCompatibleDC(pDC); CBitmap *dispBMP = new CBitmap(); dispBMP->CreateCompatibleBitmap(pDC,…
darda
  • 3,597
  • 6
  • 36
  • 49
4
votes
1 answer

BitBlt code not working

I'm trying to use this code to draw a Bitmap directly onto a PictureBox: Bitmap bmp = (Bitmap)Bitmap.FromFile(@"C:\Users\Ken\Desktop\Load2.bmp"); Graphics grDest = Graphics.FromHwnd(pictureBox1.Handle); Graphics grSrc =…
MusiGenesis
  • 74,184
  • 40
  • 190
  • 334
4
votes
2 answers

BitBlt() equivalent in Objective-C/Cocoa

I made a scrolling tile 2D video game in visual basic a few years back. I am translating it to Cocoa for the Mac. Is there a framework that would allow me to use BitBlt? Or is there an equivalent to BitBlt without using OpenGL? Thanks!
Brian
  • 63
  • 6
4
votes
2 answers

How to correctly screencapture a specific window on Aero/DWM

Background info: I have this MFC application I coded and been using for a long time that pretty much automatically saves screenshots to the hard disk when the user hits the Print Screen/Alt+Print Screen key. I have been putting off using anything…
enriquein
  • 1,048
  • 1
  • 12
  • 28
3
votes
2 answers

BitBlt Performance

I have a function that splits a multipage tiff into single pages and it uses the windows BitBlt function. In terms of performance, would the video card have any influence in doing the split? Would it be worth using a straight C/C++ library instead?
Otávio Décio
  • 73,752
  • 17
  • 161
  • 228
3
votes
1 answer

Win32 Double Buffering drawing black background

Doing a project in win32 in c++, attempting to double buffer the image being drawn, but I'm getting a black screen with the correct bitmaps drawn over it. This is also causing my WM_MOUSEMOVE condition, which drags a bitmap along with your cursor…
Aaron K
  • 437
  • 4
  • 10
3
votes
0 answers

Using SetDIBitsToDevice with RGB array. Is it faster than BitBlt?

I have an array defined as: COLORREF* array = (COLORREF*)malloc(SCR_WIDTH * SCR_HEIGHT * sizeof(COLORREF)); An algorithm updates this array with RGB colors continuously. I'm just looking for a fast way to display this image on the screen, in…
Marcos
  • 107
  • 5
3
votes
1 answer

C++ BitBlt displaying checkerboard and skewed colors

I'm attempting to draw to an off-screen device context / bitmap and move the image to the main hdc using bitblt. Here's the result I'm currently seeing: The blue, yellow, and green bars on the left are being drawn directly to the window's hdc. …
Nightmare Games
  • 2,205
  • 6
  • 28
  • 46
3
votes
0 answers

Strange behaviour of BitBlt for a second monitor that is not being set as primary

I capture images using BitBlt / StretchBlt API's on windows 10, depending upon the necessity for scaling the screen or not. Whenever I capture the 2nd monitor that is not being configured as primary, there seems to be a strange behaviour that the…
iamrameshkumar
  • 1,328
  • 1
  • 14
  • 34
3
votes
1 answer

bitblt failed on Windows 10 version 1703 (15063.138)

using Visual Studio 2017, vc141, the following code should got a screenshot from front game window but now it return a black and blank image. only issue with games(tried OpenGL and Vulkan, ogl return black, vulkan return white) before upgrade to…
Zazck
  • 81
  • 2
  • 6
3
votes
2 answers

Sprite Kit: A Lot of sprites (1000+) with Bit Blitting

I'm trying to create a scene with SpriteKit which has thousands of sprites (~500 - 2000). Each sprite is just a white pixel 1x1 - there's no need to even use textures for them. Adding this much sprites to the scene directly at once is impossible (or…
animal_chin
  • 6,610
  • 9
  • 37
  • 41
3
votes
2 answers

Win32 window capture with BitBlt not displaying border

I have written some c++ code to capture a window to a .bmp file. BITMAPFILEHEADER get_bitmap_file_header(int width, int height) { BITMAPFILEHEADER hdr; memset(&hdr, 0, sizeof(BITMAPFILEHEADER)); hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is…
ckg
  • 204
  • 3
  • 10
1
2
3
10 11