void CGDIPlusDBBView::OnInitialUpdate() { CGDIPlusDBBDoc* pDoc = GetDocument(); GdiplusStartup(&m_gdiplusToken, &m_gdiplusStartupInput, NULL); // 显示默认中国地图 USES_CONVERSION; pDoc->m_pStrMapName = "china.jpg"; CString pStrFullPath = pDoc->m_pStrMapPath + pDoc->m_pStrMapName; LPWSTR wStrFullPath = A2W(pStrFullPath); Image imgDefault(wStrFullPath); // 滚动条大小 CSize sizeTotal; sizeTotal.cx = imgDefault.GetWidth(); sizeTotal.cy = imgDefault.GetHeight(); SetScrollSizes(MM_TEXT, sizeTotal); // 准备画布 CDC * pDC = this->GetDC(); m_memDC.CreateCompatibleDC(NULL); m_memBitmap.CreateCompatibleBitmap(pDC,2000,2000); ReleaseDC(pDC); CScrollView::OnInitialUpdate(); }
/** * ImageManager::Initialize * Allocates memory for the ImageWrap array and loads in all the image files. */ void ImageManager::Init() { // TODO: This does not belong in the engine code. std::string name = "default"; ImageWrap imgDefault("assets/gfx/default.png", name); AddAsset( name, imgDefault ); name = "stick"; ImageWrap imgStick("assets/gfx/stick.png", name); AddAsset( name, imgStick ); name = "player"; ImageWrap imgPlayer("assets/gfx/delphine.png", name); AddAsset( name, imgPlayer ); name = "grass"; ImageWrap imgGrass("assets/gfx/fluffy-grass.png", name); AddAsset( name, imgGrass ); }