X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/622f7a49ef5ddf9a47096e14bf1f8d93be3c8668..e215c9959cfae9db319cbca376553301dfa17cf1:/src/common/imagbmp.cpp diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 807d3a7067..72398fcda1 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -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_RESOLUTION) ) + 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: @@ -484,7 +483,7 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height, { wxInt32 aDword, rmask = 0, gmask = 0, bmask = 0, amask = 0; int rshift = 0, gshift = 0, bshift = 0, ashift = 0; - int rbits = 0, gbits = 0, bbits = 0, abits = 0; + int rbits = 0, gbits = 0, bbits = 0; wxInt32 dbuf[4]; wxInt8 bbuf[4]; wxUint8 aByte; @@ -631,7 +630,6 @@ bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height, rshift = 16; gshift = 8; bshift = 0; - abits = 8; rbits = 8; gbits = 8; bbits = 8;