wxWidgets实现屏幕拷贝

wxImage::AddHandler( new wxBMPHandler);
                wxScreenDC DC;
                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 dirpath;
                dirpath += wxT("C:\\");
                dirpath += wxT( "1.bmp");

                 //保存文件
                bitmap.SaveFile(dirpath,wxBITMAP_TYPE_BMP);

你可能感兴趣的:(职场,wxwidgets,休闲,屏幕拷贝)