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. Blitting two different graphic bit depths?

Blitting two different graphic bit depths?

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
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.
  • A Offline
    A Offline
    Alan Chambers
    wrote on last edited by
    #1

    Hi all, just wanted to know if there is some way of blitting a 16-bit RSB graphic (manually loaded into memory using its unique binary template) to a 24-bit graphic surface? I realise that it could be done by normalising the 16-bit information of 2-bytes per pixel to three bytes per pixel and then blitting but there are two issues with this: a.) I didn't want this extra step unless it was UNAVOIDABLE. b.) I'm not sure where to start with the conversion process? I'm using DirectDraw to blit to the screen, and some custom surfaces to store the graphic data (Basically I'm trying to blit from a 640x480 16-bit plain surface to a 800x600 24-bit primary surface (but only blitting to a 640x480 portion of it)). Any ideas/viewpoints on the matter would be well apreciated. Regards all, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader

    P 1 Reply Last reply
    0
    • A Alan Chambers

      Hi all, just wanted to know if there is some way of blitting a 16-bit RSB graphic (manually loaded into memory using its unique binary template) to a 24-bit graphic surface? I realise that it could be done by normalising the 16-bit information of 2-bytes per pixel to three bytes per pixel and then blitting but there are two issues with this: a.) I didn't want this extra step unless it was UNAVOIDABLE. b.) I'm not sure where to start with the conversion process? I'm using DirectDraw to blit to the screen, and some custom surfaces to store the graphic data (Basically I'm trying to blit from a 640x480 16-bit plain surface to a 800x600 24-bit primary surface (but only blitting to a 640x480 portion of it)). Any ideas/viewpoints on the matter would be well apreciated. Regards all, Alan. "When I left you I was but the learner, now I am the master" - Darth Vader

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      You will probably be better off going to teh GDI to do the color conversions for you. You can do this by asking your DirectDrawsruface for its DC then calling the GDI function. There is really no other way to do this in DirectDraw unless you want to do it yourself, but I am willing to bet that the GDI will still be faster than what you could create.


      Build a man a fire, and he will be warm for a day
      Light a man on fire, and he will be warm for the rest of his life!

      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