
whaoye:几处对gdi资源的使用没有释放.
(发表于2003-6-6 12:52:00)

wguosong2003:用TreeView保存文件名更好
(发表于2003-8-9 21:46:00)

yifansdut:要显示一个宽度为5000px的bmp图片,显然,如果没有滚动框,这个图片无法在屏幕上显示原始大小。应该怎么来实现呢?有没有其它的更好的控件?请高手指点,不胜感激!
(发表于2004-2-5 17:09:00)

kungsin:泄露问题的解决
int Work;
int picnum;
int iPos;
RECT rect;
BITMAP bm;
HBITMAP hBitmap;
HDC hSrcDC;
HDC hDesDC;
CWnd *hwnd;
hwnd = GetDlgItem(IDC_SURVEY);
CDC * pdc;
pdc = hwnd->GetDC();
hDesDC = pdc->m_hDC;
hSrcDC = CreateCompatibleDC(hDesDC);
hBitmap=(HBITMAP)LoadImage(AfxGetInstanceHandle(),"C:\\1.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
GetObject(hBitmap, sizeof BITMAP, &bm);
SelectObject(hSrcDC, hBitmap);
hwnd->GetClientRect(&rect);
::SetStretchBltMode(hDesDC,COLORONCOLOR);
::StretchBlt(hDesDC, rect.left, rect.top, rect.right, rect.bottom, hSrcDC, 0, 0, bm.bmWidth, bm.bmHeight,+SRCCOPY);
UpdateData(false);
DeleteObject(hBitmap);
ReleaseDC(pdc);
if(!DeleteDC(hSrcDC))
{AfxMessageBox("fail");}
(发表于2006-8-10 10:20:00)
..........................................................................
--------------------next---------------------
阅读(319) | 评论(0) | 转发(0) |