if ( m_hBitmap)
{
+ // printf("About to delete bitmap %d\n", (int) (HBITMAP) m_hBitmap);
if ( !::DeleteObject((HBITMAP)m_hBitmap) )
{
wxLogLastError(wxT("DeleteObject(hbitmap)"));
bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
{
#ifdef __WXMICROWIN__
+ m_refData = new wxBitmapRefData();
// Initial attempt at a simple-minded implementation.
// The bitmap will always be created at the screen depth,
int screenDepth = ::GetDeviceCaps(hScreenDC, BITSPIXEL);
HBITMAP hBitmap = ::CreateCompatibleBitmap(hScreenDC, image.GetWidth(), image.GetHeight());
+ // printf("Created bitmap %d\n", (int) hBitmap);
if (hBitmap == NULL)
{
::ReleaseDC(NULL, hScreenDC);
::SelectObject(hMemDC, hOldBitmap);
::DeleteDC(hMemDC);
- m_refData = new wxBitmapRefData();
-
SetWidth(image.GetWidth());
SetHeight(image.GetHeight());
SetDepth(screenDepth);
SetPalette(image.GetPalette());
#endif // wxUSE_PALETTE
+#if WXWIN_COMPATIBILITY_2
+ // check the wxBitmap object
+ GetBitmapData()->SetOk();
+#endif // WXWIN_COMPATIBILITY_2
+
return TRUE;
#else
wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
{
#ifdef __WXMICROWIN__
- return wxBitmap();
+ return *this;
#else
wxMemoryDC memDC;
wxBitmap tmpBitmap(GetWidth(), GetHeight(), dc.GetDepth());