Gifs in Anwendung ?
-
Leider funzt die Suchfunktion ja im Moment nicht.
Also meine Frage: Kann man bewegte Gifs in ein Dialogfeld einbauen ? bmp geht ja, aber bei gif hab ich keine ahnung wie.
-
Man kann Gifs (mit OleLoadImagePath oder so ähnlich) öffnen und selber auf einem Window anzeigen. Einfach mal auf codeproject.com suchen.
-
oha. in englisch. da such ich mir ja nen ast. wär nett wenn mir hier einer ein beispiel reinposten könnte
-
Hier haste einen Ausschnitt aus einer Klasse die ich mal geschrieben hab. Sie heist zwar CJpgBitmap funktioniert mit gifs aber genauso.
BOOL CJpgBitmap::LoadJpg(CString Path) { UnloadPic(); USES_CONVERSION; return OleLoadPicturePath(T2OLE(Path), NULL, 0, RGB(0,0,0), IID_IPicture, (LPVOID*)&pPicture) == 0; } CSize CJpgBitmap::GetSize() { CDC* pDC = CWnd::GetDesktopWindow()->GetDC(); long hmWidth; long hmHeight; pPicture->get_Width(&hmWidth); pPicture->get_Height(&hmHeight); CSize size; size.cx = MulDiv(hmWidth, pDC->GetDeviceCaps(LOGPIXELSX), 2540); size.cy = MulDiv(hmHeight, pDC->GetDeviceCaps(LOGPIXELSY), 2540); CWnd::GetDesktopWindow()->ReleaseDC(pDC); return size; } HBITMAP CJpgBitmap::GetBitmap(int cx, int cy) { if (!pPicture) return NULL; CBitmap bmMem; CDC dcMem; CDC* pDC = CWnd::GetDesktopWindow()->GetDC(); if (dcMem.CreateCompatibleDC(pDC)) { long hmWidth; long hmHeight; pPicture->get_Width(&hmWidth); pPicture->get_Height(&hmHeight); int nWidth = cx; int nHeight = cy; if (bmMem.CreateCompatibleBitmap(pDC, nWidth, nHeight)) { CBitmap* pOldBM = dcMem.SelectObject(&bmMem); dcMem.FillSolidRect(0, 0, nWidth, nHeight, RGB(0,0,0)); HRESULT hr = pPicture->Render(dcMem, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth, -hmHeight, NULL); dcMem.SelectObject(pOldBM); } } CWnd::GetDesktopWindow()->ReleaseDC(pDC); return (HBITMAP)bmMem.Detach(); }
-
danke, werd sie mir heut abend mal zur brust nehmen