Solved

Loading BMP from Resource

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

822 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