Solved

bitmap in the file

Posted on 1998-12-10
2
177 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
ID: 1179816
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
ID: 1179817
Is it true: "Windows NT: LR_LOADFROMFILE is not supported" ?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

733 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