// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation
#endif
int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(view_y1), int WXUNUSED(view_y2),
wxHtmlRenderingInfo& WXUNUSED(info)) {}
+
+
+ DECLARE_NO_COPY_CLASS(wxHtmlImageMapAreaCell)
};
int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(view_y1), int WXUNUSED(view_y2),
wxHtmlRenderingInfo& WXUNUSED(info)) {}
+
+ DECLARE_NO_COPY_CLASS(wxHtmlImageMapCell)
};
if ( m_bmpH == -1 )
m_bmpH = hh;
+ // Only scale the bitmap at the rendering stage,
+ // so we don't lose quality twice
+/*
if ((m_bmpW != ww) || (m_bmpH != hh))
{
wxImage img2 = img.Scale(m_bmpW, m_bmpH);
m_bitmap = new wxBitmap(img2);
}
else
+*/
m_bitmap = new wxBitmap(img);
}
}
wxBitmap bmp(img);
wxMemoryDC dc;
dc.SelectObject(*m_bitmap);
- dc.DrawBitmap(bmp, m_gifDecoder->GetLeft(), m_gifDecoder->GetTop());
+ dc.DrawBitmap(bmp, m_gifDecoder->GetLeft(), m_gifDecoder->GetTop(),
+ TRUE /* use mask */);
}
else
SetImage(img);
}
if ( m_bitmap )
{
+ // We add in the scaling from the desired bitmap width
+ // and height, so we only do the scaling once.
+ double imageScaleX = 1.0;
+ double imageScaleY = 1.0;
+ if (m_bmpW != m_bitmap->GetWidth())
+ imageScaleX = (double) m_bmpW / (double) m_bitmap->GetWidth();
+ if (m_bmpH != m_bitmap->GetHeight())
+ imageScaleY = (double) m_bmpH / (double) m_bitmap->GetHeight();
+
double us_x, us_y;
dc.GetUserScale(&us_x, &us_y);
- dc.SetUserScale(us_x * m_scale, us_y * m_scale);
+ dc.SetUserScale(us_x * m_scale * imageScaleX, us_y * m_scale * imageScaleY);
- dc.DrawBitmap(*m_bitmap, (int) ((x + m_PosX) / m_scale),
- (int) ((y + m_PosY) / m_scale), TRUE);
+ dc.DrawBitmap(*m_bitmap, (int) ((x + m_PosX) / (m_scale*imageScaleX)),
+ (int) ((y + m_PosY) / (m_scale*imageScaleY)), TRUE);
dc.SetUserScale(us_x, us_y);
}
}
//--------------------------------------------------------------------------------
TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
+ TAG_HANDLER_CONSTR(IMG) { }
TAG_HANDLER_PROC(tag)
{