CImage to HBITMAP
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: CImage to HBITMAP

  1. #1
    Join Date
    Feb 2009
    Posts
    22

    CImage to HBITMAP

    Hello,

    I have problem with this code:

    Code:
    	CImage tmpImg;
    	HRESULT hResult = tmpImg.Load(L"C:\\img-1.gif");	
    	tmpImg.Create(tmpImg.GetWidth(), tmpImg.GetHeight(), tmpImg.GetBPP());
    and the problem is that assert m_hBitmap == 0 fails.

    I just need to create real HBITMAP from CImage without casting (CImage:perator HBITMAP()).

    Thank you for help!

  2. #2
    Join Date
    Jul 2002
    Posts
    2,512

    Re: CImage to HBITMAP

    Load and Create after this - too much for the same CImage instance. tmpImg is ready for use after Load, why do you need Create?

  3. #3
    Join Date
    Feb 2009
    Posts
    22

    Re: CImage to HBITMAP

    well what I really try to do is insert gif image into rich edit control and I need somehow to convert gif into bitmap.

    http://www.codeguru.com/cpp/controls...cle.php/c2417/ - here's the code for inserting images in rich edit for bitmaps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center