SIZE sizeRect;
const size_t len = string.length();
- if ( !::GetTextExtentPoint32(GetHdc(), string.wx_str(), len, &sizeRect) )
+ if ( !::GetTextExtentPoint32(GetHdc(), string.t_str(), len, &sizeRect) )
{
wxLogLastError(wxT("GetTextExtentPoint32()"));
}
// than the wxWidgets fall-back implementation. So we need
// to be able to switch this on and off at runtime.
#if wxUSE_SYSTEM_OPTIONS
- if (wxSystemOptions::GetOptionInt(wxT("no-maskblt")) == 0)
+ static bool s_maskBltAllowed = wxSystemOptions::GetOptionInt("no-maskblt") == 0;
+ if ( s_maskBltAllowed )
#endif
{
if ( dstWidth == srcWidth && dstHeight == srcHeight )
{
SET_STRETCH_BLT_MODE(GetHdc());
+ // Unlike all the other functions used here (i.e. AlphaBlt(),
+ // MaskBlt(), BitBlt() and StretchBlt()), StretchDIBits() does
+ // not take into account the source DC logical coordinates
+ // automatically as it doesn't even work with the source HDC.
+ // So do this manually to ensure that the coordinates are
+ // interpreted in the same way here as in all the other cases.
+ xsrc = source->LogicalToDeviceX(xsrc);
+ ysrc = source->LogicalToDeviceY(ysrc);
+ srcWidth = source->LogicalToDeviceXRel(srcWidth);
+ srcHeight = source->LogicalToDeviceYRel(srcHeight);
+
// Figure out what co-ordinate system we're supposed to specify
// ysrc in.
const LONG hDIB = ds.dsBmih.biHeight;