]> git.saurik.com Git - wxWidgets.git/commitdiff
use GetResolutionFromOptions() to honour wxIMAGE_OPTION_RESOLUTION and not just wxIMA...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 17 Nov 2008 14:32:10 +0000 (14:32 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 17 Nov 2008 14:32:10 +0000 (14:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagbmp.cpp

index 83a22d91eafb4e00a0c1a3a2ced2966684b53116..72398fcda17cd73753b9f0e7f9019380bb2b1068 100644 (file)
@@ -180,9 +180,8 @@ bool wxBMPHandler::SaveDib(wxImage *image,
 
     // get the resolution from the image options  or fall back to 72dpi standard
     // for the BMP format if not specified
-    wxUint32 hres = image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONX),
-             vres = image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONY);
-    switch ( image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONUNIT) )
+    int hres, vres;
+    switch ( GetResolutionFromOptions(*image, &hres, &vres) )
     {
         default:
             wxFAIL_MSG( _T("unexpected image resolution units") );
@@ -195,8 +194,8 @@ bool wxBMPHandler::SaveDib(wxImage *image,
 
         case wxIMAGE_RESOLUTION_INCHES:
             // convert resolution in inches to resolution in centimeters
-            hres = (wxUint32)(10*mm2inches*hres);
-            vres = (wxUint32)(10*mm2inches*vres);
+            hres = (int)(10*mm2inches*hres);
+            vres = (int)(10*mm2inches*vres);
             // fall through to convert it to resolution in meters
 
         case wxIMAGE_RESOLUTION_CM: