added support for image resolution options to PNG handler (heavily modified patch 1704128)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-04-21 19:29:01 +00:00
parent defde6bc66
commit 361f4288eb
4 changed files with 84 additions and 28 deletions

View File

@@ -37,9 +37,17 @@
#define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(_T("ResolutionUnit"))
// constants used with wxIMAGE_OPTION_RESOLUTIONUNIT
enum
//
// NB: don't change these values, they correspond to libjpeg constants
enum wxImageResolution
{
// Resolution not specified
wxIMAGE_RESOLUTION_NONE = 0,
// Resolution specified in inches
wxIMAGE_RESOLUTION_INCHES = 1,
// Resolution specified in centimeters
wxIMAGE_RESOLUTION_CM = 2
};
@@ -112,6 +120,13 @@ protected:
bool CallDoCanRead(wxInputStream& stream);
#endif // wxUSE_STREAMS
// helper for the derived classes SaveFile() implementations: returns the
// values of x- and y-resolution options specified as the image options if
// any
static wxImageResolution
GetResolutionFromOptions(const wxImage& image, int *x, int *y);
wxString m_name;
wxString m_extension;
wxString m_mime;