Solved

bitmap in the file

Posted on 1998-12-10
2
174 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

810 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