X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0deb5fab34f3cc90d717347b7335297ff67cc1b3..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/msw/dib.cpp diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 0c89e7e5ad..00ed0789cc 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -286,7 +286,7 @@ bool wxDIB::Load(const wxString& filename) m_handle = (HBITMAP)::LoadImage ( wxGetInstance(), - filename, + filename.fn_str(), IMAGE_BITMAP, 0, 0, // don't specify the size LR_CREATEDIBSECTION | LR_LOADFROMFILE @@ -307,6 +307,7 @@ bool wxDIB::Save(const wxString& filename) { wxCHECK_MSG( m_handle, false, _T("wxDIB::Save(): invalid object") ); +#if wxUSE_FILE wxFile file(filename, wxFile::write); bool ok = file.IsOpened(); if ( ok ) @@ -335,6 +336,9 @@ bool wxDIB::Save(const wxString& filename) file.Write(ds.dsBm.bmBits, sizeImage) == sizeImage; } } +#else // !wxUSE_FILE + bool ok = false; +#endif // wxUSE_FILE/!wxUSE_FILE if ( !ok ) { @@ -785,9 +789,9 @@ wxImage wxDIB::ConvertToImage() const *alpha++ = a; if ( a > 0 ) { - dst[0] = (dst[0] * 255 - 127) / a; - dst[1] = (dst[1] * 255 - 127) / a; - dst[2] = (dst[2] * 255 - 127) / a; + dst[0] = (dst[0] * 255) / a; + dst[1] = (dst[1] * 255) / a; + dst[2] = (dst[2] * 255) / a; } }