l 设置屏幕大小
在函数OnInitialUpdate()中设置sizeTotal
l 显示图像代码
void CMyScrollView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
BITMAP bmpstr;
bmp.GetBitmap(&bmpstr);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(&bmp);
pDC->BitBlt(100,0,bmpstr.bmWidth,bmpstr.bmHeight,&memDC,0,0,SRCCOPY);
memDC.DeleteDC();
bmp.DeleteObject();
}
l 只需添加如下函数就可访问网页
void CHtml::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
Navigate(L"http://hao123.com");
this->GetDocument()->SetTitle(L"hao123");
}