Jump to content
  • Advertisement
Sign in to follow this  
SiKaNrOnG

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

This topic is 4842 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
Advertisement
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.

hth
Jack

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!