|
|
|
контрол Picture
|
|||
|---|---|---|---|
|
#18+
Visual C++ 6.0 Project MDI На всё окно вывожу картинку clouds.bmp ( плывущие облака) Как только изменю рахмер окна Картинка исчезает. Как избежать этого, т.е. исчезновение картинки. Код находится в классе вида, вызывю через пункт меню. Если это в WM_SIZE, то какой код Должен быть? CDC* pDC = GetDC(); CMy_MDI5Doc * pDoc = GetDocument(); ASSERT_VALID(pDoc); // Load IDB_BITMAP1 from the resources. CBitmap bmp; if (bmp.LoadBitmap(IDB_BITMAP6)) { // Get the size of the bitmap. BITMAP bmpInfo; bmp.GetBitmap(&bmpInfo); // Create an in-memory device context compatible with the // display device context that is used to paint. CDC dcMemory; dcMemory.CreateCompatibleDC(pDC); // Select the bitmap into the in-memory device context. CBitmap* pOldBitmap = dcMemory.SelectObject(&bmp); // Find a center point for the bitmap in the client area. CRect rect; GetClientRect(&rect); int nX = rect.left + (rect.Width() - bmpInfo.bmWidth) / 2; int nY = rect.top + (rect.Height() - bmpInfo.bmHeight) / 2; // Copy the bits from the in-memory device context to the on- // screen device context to do the painting. Use the computed center // point for the target offset. pDC->BitBlt(nX, nY, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory, 0, 0, SRCCOPY); dcMemory.SelectObject(pOldBitmap); } СПАСИБО ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.05.2006, 11:17 |
|
||
|
|

start [/forum/topic.php?fid=57&fpage=355&tid=2031281]: |
0ms |
get settings: |
7ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
40ms |
get topic data: |
9ms |
get forum data: |
3ms |
get page messages: |
25ms |
get tp. blocked users: |
1ms |
| others: | 219ms |
| total: | 326ms |

| 0 / 0 |
