Solved

Loading BMP from Resource

Posted on 1998-03-17
4
251 Views
Last Modified: 2010-04-04
I am trying to load BitMap from resource with next Delphi2 code:


      {$R Resource}

          Bitmap := TBitmap.Create;
          Bitmap.LoadFromResourceName(HInstance, 'Bitmap1');


But I am getting message:

      "Resource BITMAP1 not found."

What have I done wrong?
0
Comment
Question by:bor061297
[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
4 Comments
 
LVL 2

Accepted Solution

by:
shogi earned 50 total points
ID: 1360575

This is ok
      Bitmap := TBitmap.Create;
      Bitmap.LoadFromResourceName(HInstance, 'Bitmap1');

Two possibility :
1) {$R Resource}   it's not the good one
2) your resource.res file don't have the Bitmap1 in .

Regards
Shogi
0
 

Expert Comment

by:petervl
ID: 1360576
Also Verify that your resource file doesn't have the same name as your application as Delphi will overwrite that to add the main Icon, version information etc.
0
 

Author Comment

by:bor061297
ID: 1360577
Neither of it...
0
 

Author Comment

by:bor061297
ID: 1360578
Neither of it...
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

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