This patch series reworks `D3DXSaveSurfaceToFileInMemory()` to use the new `d3dx_save_pixels_to_memory()` function.
It also adds support for selecting a replacement pixel format when the image file format being saved to doesn't have direct support for the pixel format being saved. The code for calculating the best replacement format was inspired by the code in `check_texture_requirements()` in `d3dx9_36/texture.c`. This should fix WineHQ bug 51584, but I haven't tested that.
-- v2: d3dx9: Add support for saving DIB files in d3dx_save_pixels_to_memory(). d3dx9: Add support for saving paletted pixel formats in d3dx_pixels_save_wic(). d3dx9: Add support for saving BMP files in d3dx_save_pixels_to_memory(). d3dx9: Add support for saving JPG files in d3dx_save_pixels_to_memory(). d3dx9: Add support for saving PNG files in d3dx_save_pixels_to_memory().