wxBitmap::UseAlpha can be used only on wxMSW and wxOSX.
This method is not implemented on all ports.
This commit is contained in:
parent
85bad08373
commit
3cc8b4ae37
@ -223,7 +223,10 @@ void wxArtProvider::RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded)
|
||||
#else // !wxUSE_IMAGE
|
||||
// Fallback method of scaling the bitmap
|
||||
wxBitmap newBmp(sizeNeeded);
|
||||
#if defined(__WXMSW__) || defined(__WXOSX__)
|
||||
// wxBitmap::UseAlpha() is used only on wxMSW and wxOSX.
|
||||
newBmp.UseAlpha(bmp.HasAlpha());
|
||||
#endif // __WXMSW__ || __WXOSX__
|
||||
{
|
||||
wxMemoryDC dc(newBmp);
|
||||
double scX = (double)sizeNeeded.GetWidth() / bmp.GetWidth();
|
||||
|
@ -2209,7 +2209,7 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp )
|
||||
|
||||
if ( imSz.y != maxSz.y )
|
||||
{
|
||||
#if wxUSE_IMAGE
|
||||
#if wxUSE_IMAGE
|
||||
// Here we use high-quality wxImage scaling functions available
|
||||
wxImage img = bmp.ConvertToImage();
|
||||
double scaleY = (double)maxSz.y / (double)imSz.y;
|
||||
@ -2217,17 +2217,20 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp )
|
||||
wxRound(bmp.GetHeight()*scaleY),
|
||||
wxIMAGE_QUALITY_HIGH);
|
||||
wxBitmap* bmpNew = new wxBitmap(img);
|
||||
#else
|
||||
#else // !wxUSE_IMAGE
|
||||
// This is the old, deprecated method of scaling the image
|
||||
wxBitmap* bmpNew = new wxBitmap(maxSz.x,maxSz.y,bmp.GetDepth());
|
||||
#if defined(__WXMSW__) || defined(__WXOSX__)
|
||||
// wxBitmap::UseAlpha() is used only on wxMSW and wxOSX.
|
||||
bmpNew->UseAlpha(bmp.HasAlpha());
|
||||
#endif // __WXMSW__ || __WXOSX__
|
||||
{
|
||||
wxMemoryDC dc(*bmpNew);
|
||||
double scaleY = (double)maxSz.y / (double)imSz.y;
|
||||
dc.SetUserScale(scaleY, scaleY);
|
||||
dc.DrawBitmap(bmp, 0, 0);
|
||||
}
|
||||
#endif
|
||||
#endif // wxUSE_IMAGE/!wxUSE_IMAGE
|
||||
|
||||
m_valueBitmap = bmpNew;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user