From: phil.jacobs on 20 Feb 2007 07:28 I am displaying a bitmap in MFC at the moment, but have how got gifs and jpgs that I want to show in the same place and I am not sure how best to do it. My code is as follows for showing bmp: HANDLE handle(::LoadImage(AfxGetInstanceHandle(), "C:\image.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)); if (handle) { m_bitmap.DeleteObject(); VERIFY(m_bitmap.Attach((HBITMAP)handle)); BITMAP bi; ::ZeroMemory(&bi, sizeof(bi)); m_bitmap.GetBitmap (&bi); } This shows bmps nicely, but now I have a gif. any ideas?!?!?!?!?
From: Ajay Kalra on 20 Feb 2007 09:38 On Feb 20, 7:28 am, phil.jac...(a)starlizard.com wrote: > I am displaying a bitmap in MFC at the moment, but have how got gifs > and jpgs that I want to show in the same place and I am not sure how > best to do it. My code is as follows for showing bmp: > > HANDLE handle(::LoadImage(AfxGetInstanceHandle(), "C:\image.bmp", > IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)); > if (handle) { > m_bitmap.DeleteObject(); > VERIFY(m_bitmap.Attach((HBITMAP)handle)); > > BITMAP bi; > ::ZeroMemory(&bi, sizeof(bi)); > m_bitmap.GetBitmap (&bi); > > } > > This shows bmps nicely, but now I have a gif. any ideas?!?!?!?!? Using GDI+: http://msdn.microsoft.com/msdnmag/issues/02/03/c/default.aspx Using IPicture: http://msdn.microsoft.com/msdnmag/issues/01/10/c/ --- Ajay
From: AliR (VC++ MVP) on 20 Feb 2007 11:23 Take a look at CImage, it loads JPEG, GIF, BMP and PNG files. AliR. <phil.jacobs(a)starlizard.com> wrote in message news:1171974522.335262.268580(a)k78g2000cwa.googlegroups.com... >I am displaying a bitmap in MFC at the moment, but have how got gifs > and jpgs that I want to show in the same place and I am not sure how > best to do it. My code is as follows for showing bmp: > > HANDLE handle(::LoadImage(AfxGetInstanceHandle(), "C:\image.bmp", > IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)); > if (handle) { > m_bitmap.DeleteObject(); > VERIFY(m_bitmap.Attach((HBITMAP)handle)); > > BITMAP bi; > ::ZeroMemory(&bi, sizeof(bi)); > m_bitmap.GetBitmap (&bi); > } > > This shows bmps nicely, but now I have a gif. any ideas?!?!?!?!? >
|
Pages: 1 Prev: CListCtrl in report mode and column header Next: CToolTipCtrl and HitTest |