Posted on 2008-11-16 11:53
chefZ 阅读(169)
评论(0) 编辑 收藏 引用
wxSize screenSize = wxGetDisplaySize();
wxBitmap bitmap(screenSize.x, screenSize.y);
wxScreenDC dc;
wxMemoryDC memDC;
memDC.SelectObject(bitmap);
memDC.Blit(0, 0, screenSize.x, screenSize.y, &dc, 0, 0);
memDC.SelectObject(wxNullBitmap);
wxString fname = wxFileName::CreateTempFileName(wxT("screenshot"));
bitmap.SaveFile(fname, wxBITMAP_TYPE_PNG);