BitBlt is too slow

Артём Лосев 20 Reputation points
2024-03-27T15:50:07.58+00:00

Is there an analogue of copying a rectangle from the screen that works faster? Or how do I optimize it?

_ = BitBlt(
        h_dc,
        0,
        0,
        config.rect.size.x,
        config.rect.size.y,
        h_src,
        config.rect.pos.x,
        config.rect.pos.y,
        SRCCOPY
    ).unwrap();

On average 16 ms on my pc. It's too slow.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,726 Reputation points
    2024-03-27T18:57:49.9033333+00:00

    It depends on what you want to do

    In GDI, double buffering can be used (like with BeginBufferedPaint) but

    for fast animations or graphic effects the best technology is Direct2D

    (BitBlt is not used, but interfaces like ID2D1Bitmap or ID2D1SpriteBatch)

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful