CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Location
    Malaysia
    Posts
    224

    From Bitmap File to HBITMAP

    Hello;
    I would like to know, is it possible to get the HBITMAP from a *.bmp (or *.dib) without show the
    file into a HDC? Anyone can show me a easy way to do this in Win32/MFC?
    Thanks


    Hello World!!!

  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: From Bitmap File to HBITMAP

    The ::LoadImage() function returns a handle which can be cast to an HBITMAP (I believe), although you can't load from file using this function under NT (for some stupid reason).



    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    Apr 1999
    Posts
    6

    Re: From Bitmap File to HBITMAP

    LoadImage along with some extra code can be used to read a BMP file. Refer to Article ID: Q158898 "How To Use LoadImage() to Read a BMP File" in MSDN.
    You can use ::ReadDIBFile for *.dib files. Refer to DIBLOOK example of MSDN for the same

    Hope this helps






Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured