How to save a Directdraw7 surface to .bmp?

Started by
3 comments, last by Dale 20 years ago
Hi. Subject says it all. Is there any tutorials on how to save a Win32 Directdraw7 surface to a bitmap file as 24-bit?
-----------------------------Empires! Visit online at http://www.daleszone.comProgramming for a funner world.
Advertisement
In Delphi you can get the Handle of the DirectDraw7 surface, typecast to a TCanvas object which can then be saved as a bitmap.

Not sure if this helps you though
He is probably using C++, and so, your advice is useless. Thus, it''s reverse engineering the loading code. Read this article, on loading a BMP, and I think you get the idea of how to save a bitmap(If you create the header, etc. and then write the data from the surface to the file)

http://www.gamedev.net/reference/articles/article1966.asp

Toolmaker


-Earth is 98% full. Please delete anybody you can.

Oh sorry, I did mean in C++. My bad.

Anyways, thanks both of you for the advice. I''d seen that article, but thought there might be something similar for saving. But I''ll re-go through it and give it a go on the weekend.

BTW, if you''re interested, I''ve got a map loading system similar to SimCity4 where you can create a map from a jpeg (I chose bmp), and I wanted to save a bmp from the editor. Yes, I know the file is larger than any sort of text file I could generate from the map editor, but it means the end user can create a bmp file on their own and import it.

Thanks
Dale
-----------------------------Empires! Visit online at http://www.daleszone.comProgramming for a funner world.
I *think* you can retrieve the HDC of the surface and then write it to a file with GDI+. That might save you the trouble of writing a bitmap file writer.

This topic is closed to new replies.

Advertisement