Solved

Loading BMP from Resource

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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