Solved

bitmap in the file

Posted on 1998-12-10
2
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: 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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

688 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