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