Advertisement Jump to content
Sign in to follow this  

How do I use load JPEG files into onto direct draw surfaces??? ASAP!

This topic is 4902 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anybody have a pre-made function I can have to load JPEG files (as opposed to BMP files) onto DDraw surfaces? Or, I dunno, something else I can use to the same extent?

Share this post

Link to post
Share on other sites
I don't have a ready-made function for you, but I can point you in a possible direction if thats helpful [smile]

Firstly you might be able to abuse D3DX to load your image onto a IDirect3DSurface9 and then use various binary copying techniques to write it back to a IDirectDrawSurface7 object. This is quite easy, but it would at the very least require your target machine to have DX9 installed.

Secondly, all the solutions I've seen for DD7 (including the VB6 code I wrote many years ago) involved using another library to load the data from the file and then "reading" the bitmap information from this library and writing it manually into the DD7 surface.

You might want to look into GDI/GDI+ interfaces (try here for GDI+) as they should present you with a regular DC surface - which is pretty simple to directly copy (if formats match) or convert manually (if formats differ) to a DD7 surface.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!