Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. bitblt a bitmap greater than screen resolution, bitmap doesn't display correctly

bitblt a bitmap greater than screen resolution, bitmap doesn't display correctly

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiongraphics
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yoshibebe
    wrote on last edited by
    #1

    I have created a DDB bitmap of size (1024x2048) and have selected it into a compatible DC. Here is the code: hdc = GetDC (hwnd); hBitmap = CreateCompatibleBitmap (hdc, 1024, 2048); hdcMem = CreateCompatibleDC (hdc); SelectObject( hdcMem, hBitmap); ReleaseDC (hwnd,hdc); My problem is when I draw on the hdcMem and then bitblt it to my Window DC. Everything works fine until I try a bitblt with an X coordinate (hdcMem) greater than 800. My current screen Resolution is 800x600. Why is this? How can I fix it? This is not a problem for the Y axis. I suspect that the hdcMem has some sort of limitations based on the current resolution, but I can't figure it out. What happens is that the bitmap seems to be cut in half. The bitmap displays fine up to the 800 point, but after that, it doesn't show at all.

    T 1 Reply Last reply
    0
    • Y yoshibebe

      I have created a DDB bitmap of size (1024x2048) and have selected it into a compatible DC. Here is the code: hdc = GetDC (hwnd); hBitmap = CreateCompatibleBitmap (hdc, 1024, 2048); hdcMem = CreateCompatibleDC (hdc); SelectObject( hdcMem, hBitmap); ReleaseDC (hwnd,hdc); My problem is when I draw on the hdcMem and then bitblt it to my Window DC. Everything works fine until I try a bitblt with an X coordinate (hdcMem) greater than 800. My current screen Resolution is 800x600. Why is this? How can I fix it? This is not a problem for the Y axis. I suspect that the hdcMem has some sort of limitations based on the current resolution, but I can't figure it out. What happens is that the bitmap seems to be cut in half. The bitmap displays fine up to the 800 point, but after that, it doesn't show at all.

      T Offline
      T Offline
      twing
      wrote on last edited by
      #2

      try on using stretchblt() Hello World!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups