Solved

bitmap in the file

Posted on 1998-12-10
2
171 Views
Last Modified: 2010-04-02
I must load bitmap from file ***.bmp

    CBitmap pBitmapLib = new CBitmap();
    pBitmapLib->LoadBitmap("class_lib.bmp");

 Function CBitmap::LoadBitmap returned 0.
I also tryed to use a full path, but I got same result.
Whot can I do whis this problem.
My platform: Windows NT, VC++ 5.
0
Comment
Question by:atkach
2 Comments
 
LVL 4

Accepted Solution

by:
pagladasu earned 100 total points
Comment Utility
Use the Win32 API  LoadImage()
HBITMAP m_hBitmap;
m_hBitmap=(HBITMAP)::LoadImage(
      NULL,"Dance1.bmp",IMAGE_BITMAP,
      0,0,LR_LOADFROMFILE|LR_DEFAULTSIZE);  
CBitmap *mbmp=CBitmap::FromHandle(m_hBitmap);

Now you can use mbmp to refer to that bitmap.

Thanks
pagladasu
0
 
LVL 1

Expert Comment

by:V245
Comment Utility
Is it true: "Windows NT: LR_LOADFROMFILE is not supported" ?
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now