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. How do I handle multiple bitmaps in memory?

How do I handle multiple bitmaps in memory?

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicsperformance
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.
  • I Offline
    I Offline
    Iceman
    wrote on last edited by
    #1

    I'm trying to take multiple small bitmaps, BitBlt them into a memory dc then using a mask, draw them transparently to the screen. With one bitmap from a file it works fine, but when I combine them to an in memory DC and do the transparent blt, the colors get screwed up.

    M 1 Reply Last reply
    0
    • I Iceman

      I'm trying to take multiple small bitmaps, BitBlt them into a memory dc then using a mask, draw them transparently to the screen. With one bitmap from a file it works fine, but when I combine them to an in memory DC and do the transparent blt, the colors get screwed up.

      M Offline
      M Offline
      MAAK
      wrote on last edited by
      #2

      try to use TransparentBlt(), it uses chroma key to apply the transparency, and much easier

      BOOL TransparentBlt(
        HDC hdcDest,        // handle to destination DC
        int nXOriginDest,   // x-coord of destination upper-left corner
        int nYOriginDest,   // y-coord of destination upper-left corner
        int nWidthDest,     // width of destination rectangle
        int hHeightDest,    // height of destination rectangle
        HDC hdcSrc,         // handle to source DC
        int nXOriginSrc,    // x-coord of source upper-left corner
        int nYOriginSrc,    // y-coord of source upper-left corner
        int nWidthSrc,      // width of source rectangle
        int nHeightSrc,     // height of source rectangle
        UINT crTransparent  // color to make transparent
      );
      
      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