- if (m_Image)
-// dc.DrawBitmap(*m_Image, x + m_PosX, y + m_PosY, (m_Image->GetMask() != (wxMask*) 0));
- dc.DrawBitmap(*m_Image, x + m_PosX, y + m_PosY, TRUE);
- wxHtmlCell::Draw(dc, x, y, view_y1, view_y2);
+ wxHtmlCell::Layout(w);
+ m_physX = m_physY = -1;
+}
+
+#endif
+
+wxHtmlImageCell::~wxHtmlImageCell()
+{
+ delete m_bitmap;
+#if wxUSE_GIF && wxUSE_TIMER
+ delete m_gifTimer;
+ delete m_gifDecoder;
+#endif
+}
+
+
+void wxHtmlImageCell::Draw(wxDC& dc, int x, int y,
+ int WXUNUSED(view_y1), int WXUNUSED(view_y2),
+ wxHtmlRenderingInfo& WXUNUSED(info))
+{
+ if ( m_showFrame )
+ {
+ dc.SetBrush(*wxTRANSPARENT_BRUSH);
+ dc.SetPen(*wxBLACK_PEN);
+ dc.DrawRectangle(x + m_PosX, y + m_PosY, m_Width, m_Height);
+ x++, y++;
+ }
+ 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 * imageScaleX, us_y * m_scale * imageScaleY);
+
+ 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);
+ }