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

Started by
1 comment, last by doctorsixstring 18 years, 8 months ago
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?
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Check out DevIL. Its very easy to use (from personal experience).

This topic is closed to new replies.

Advertisement