I already searched the forum and on Google without success on this topic. My problem is as follows: I use a wxClientDC to draw some stuff onto a ScrolledWindow, which works fine. In order to save the content of the DC into a file, I use a wxBitmap and a wxImage (see code below). Saving seems to work properly, but the saved image file always (not depending on the format) has a resolution of 1 dpi, which is quite annoying when eg. printing it with some external software.
So here comes my question: Is there a way to set the resoltion to another value? I only found such a feature in wxPostScriptDC.
Thanks & Greetings
Johannes
Here the code I use.
Code: Select all
int iDCWidth = 0; int iDCHeight = 0;
m_pwxDC->GetSize(&iDCWidth, &iDCHeight); // m_pwxDC is the wxClientDC I use for drawing
m_wxSaveBitmap.Create(iDCWidth,iDCHeight); // m_wxSaveBitmap is a wxBitmap I use for saving
wxMemoryDC wxSaveMemDC = new wxMemoryDC();
if (!wxSaveMemDC.Ok())
return false;
wxSaveMemDC.SelectObject(m_wxSaveBitmap);
double dX = 0; double dY = 0;
wxSaveMemDC.Blit(wxPoint(0,0),m_pwxDC->GetSize(), m_pwxDC, wxPoint(0,0));
wxImage wxSaveImage = m_wxSaveBitmap.ConvertToImage();
if (wxsFileName.empty())
{
wxSaveMemDC.SelectObject(wxNullBitmap);
return false;
}
wxSaveImage.SaveFile(wxsFileName);
wxSaveMemDC.SelectObject(wxNullBitmap);
return true;