• Advertisement
Sign in to follow this  

how to save the textrue of the display?

This topic is 4180 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

Advertisement
I don't know of a built in way to save a texture (I'm assuming D3D here, perhaps wrongly).

One thing you can do, if you have something like Paint Shop Pro, that supports RAW format, is to lock the texture, then based on the pixel format, just spit out RGBRGBRGB... to a .raw file.

You could then open the file with an image editor that supports RAW, specify the height and with, then resave it as a bitmap or whatever.

If you just want to save it in order to reload it to a texture in the future, you could just lock the texture and dump the binary contents to a file I suppose.

If you want to save directly to a bitmap, you would have to fill in BITMAPHEADER and BITMAPINFO structures correctly and then output the pixel data, although I believe bitmap format inverts the scanline order if memory serves.

Another possiblity would be to convert the texture pixel data into an array of RGBQUADs, then use the Win32 SetDIBits API call to put these into a previously created BITMAP, although I believe you would still have to write the saving code manually.

Just drivelling ideas really. I personally am currently looking at saving textures in a custom image format for ease of use, then having another application that will convert this format to bitmap format, in order to not weigh down my Direct3D code with all the bitmap shennanigans.

HTH and sorry I don't have a simple answer.

Paul

Share this post


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

  • Advertisement