-void wxBitmapDataObject::DoConvertToPng()
-{
- if (!m_bitmap.Ok())
- return;
-
- wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL,
- wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") );
-
- wxImage image = m_bitmap.ConvertToImage();
-
- wxCountingOutputStream count;
- image.SaveFile(count, wxBITMAP_TYPE_PNG);
-
- m_pngSize = count.GetSize() + 100; // sometimes the size seems to vary ???
- m_pngData = malloc(m_pngSize);
-
- wxMemoryOutputStream mstream((char*) m_pngData, m_pngSize);
- image.SaveFile(mstream, wxBITMAP_TYPE_PNG);
-}
-