use GetResolutionFromOptions() to honour wxIMAGE_OPTION_RESOLUTION and not just wxIMAGE_OPTION_RESOLUTION[XY]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -180,9 +180,8 @@ bool wxBMPHandler::SaveDib(wxImage *image,
|
|||||||
|
|
||||||
// get the resolution from the image options or fall back to 72dpi standard
|
// get the resolution from the image options or fall back to 72dpi standard
|
||||||
// for the BMP format if not specified
|
// for the BMP format if not specified
|
||||||
wxUint32 hres = image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONX),
|
int hres, vres;
|
||||||
vres = image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONY);
|
switch ( GetResolutionFromOptions(*image, &hres, &vres) )
|
||||||
switch ( image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONUNIT) )
|
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
wxFAIL_MSG( _T("unexpected image resolution units") );
|
wxFAIL_MSG( _T("unexpected image resolution units") );
|
||||||
@@ -195,8 +194,8 @@ bool wxBMPHandler::SaveDib(wxImage *image,
|
|||||||
|
|
||||||
case wxIMAGE_RESOLUTION_INCHES:
|
case wxIMAGE_RESOLUTION_INCHES:
|
||||||
// convert resolution in inches to resolution in centimeters
|
// convert resolution in inches to resolution in centimeters
|
||||||
hres = (wxUint32)(10*mm2inches*hres);
|
hres = (int)(10*mm2inches*hres);
|
||||||
vres = (wxUint32)(10*mm2inches*vres);
|
vres = (int)(10*mm2inches*vres);
|
||||||
// fall through to convert it to resolution in meters
|
// fall through to convert it to resolution in meters
|
||||||
|
|
||||||
case wxIMAGE_RESOLUTION_CM:
|
case wxIMAGE_RESOLUTION_CM:
|
||||||
|
Reference in New Issue
Block a user