My Environment: Ubuntu 14.04 + wxWidgets with Gtk2
I am trying draw bitmap image on Memory DC, at that time I am getting Gdk-WARNING
Below is my code:Gdk-WARNING **: The gdk_draw_*_image require the drawable argument to
have a specified colormap. All windows have a colormap,
however, pixmaps only have colormap by default if they
were created with a non-NULL window argument. Otherwise
a colormap must be set on them with gdk_drawable_set_colormap
Code: Select all
wxMemoryDC *pBitmap = new wxBitmap(m_Label.nWidth, m_Label.nHeight, 1);
wxBitmap *pmDC = new wxMemoryDC(*pBitmap);
pmDC->SelectObject(*pBitmap);
pmDC->SetBackground(*wxWHITE_BRUSH);
wxPen pen(*wxBLACK_PEN);
pen.SetStyle(wxSOLID);
pmDC->SetPen(pen)
wxString szFilename("Logo.bmp");
wxBitmap bmp;
bool l_bStatus = bmp.LoadFile(szFilename);
if (pmDC->CanDrawBitmap()) { // Returns True
if (bmp.IsOk()) // Returns True
pmDC->DrawBitmap(bmp, 50, 70,false);
else
printf("No bitmap content");
}
Thanks,
Hari