Solved

Loading BMP from Resource

Posted on 1998-03-17
4
245 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
  • 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

23 Experts available now in Live!

Get 1:1 Help Now