drawImage method

void drawImage(
  1. int hdc,
  2. int hBitmap,
  3. int x,
  4. int y,
  5. int width,
  6. int height,
)

Paint operation: draws hBitmap at coordinates x, y.

  • Calls Win32 BitBlt to copy the Bitmap bytes to this Window.

Implementation

void drawImage(int hdc, int hBitmap, int x, int y, int width, int height) {
  final hMemDC = CreateCompatibleDC(hdc);

  SelectObject(hMemDC, hBitmap);
  BitBlt(hdc, x, y, width, height, hMemDC, 0, 0, ROP_CODE.SRCCOPY);
  DeleteObject(hMemDC);
}