Added wxIMAGE_OPTION_ORIGINAL_{WIDTH,HEIGHT} wxImage options.
These options allow to retrieve the original image size if the image was scaled during load. Closes #13662. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2450,7 +2450,17 @@ bool wxImage::DoLoad(wxImageHandler& handler, wxInputStream& stream, int index)
|
||||
}
|
||||
|
||||
if ( width != widthOrig || height != heightOrig )
|
||||
{
|
||||
// get the original size if it was set by the image handler
|
||||
// but also in order to restore it after Rescale
|
||||
int widthOrigOption = GetOptionInt(wxIMAGE_OPTION_ORIGINAL_WIDTH),
|
||||
heightOrigOption = GetOptionInt(wxIMAGE_OPTION_ORIGINAL_HEIGHT);
|
||||
|
||||
Rescale(width, height, wxIMAGE_QUALITY_HIGH);
|
||||
|
||||
SetOption(wxIMAGE_OPTION_ORIGINAL_WIDTH, widthOrigOption ? widthOrigOption : widthOrig);
|
||||
SetOption(wxIMAGE_OPTION_ORIGINAL_HEIGHT, heightOrigOption ? heightOrigOption : heightOrig);
|
||||
}
|
||||
}
|
||||
|
||||
// Set this after Rescale, which currently does not preserve it
|
||||
|
Reference in New Issue
Block a user