Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Load bitmap from RES, DLL or EXE

Posted on 2004-08-10
2
Medium Priority
?
447 Views
Last Modified: 2010-04-05
Hi, I need to load bitmaps from resourcefile (PRGImages.res)?
After loading the bitmap it must be assigned to SpeedButton1.Glyph.

Or what is the fastest and good way to set this up?
       1. add bmp's to a RES?
       2. add bmp's to the EXE?
       3. add bmp's to a DLL?

The RES-file (option 1) I already have (PRGImages.res with 3 bmp 16x16).
Options 2 and 3 should also include the way to add the bmp's into the EXE or DLL.

I would prefer some code (f.e. project).

Thanks a lot for your help. Stef
0
Comment
Question by:Delphiwizard
[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
2 Comments
 
LVL 4

Accepted Solution

by:
alikoank earned 2000 total points
ID: 11760557
you can embed your resource files into executables by {$R} directive put it under the same directive for your forms.

{$R *.DFM}
{$R MyResourceFile.res}

if you have a bitmap in your resource file you can assign this bitmap to an image like this

Image1.Picture.Bitmap.Handle := LoadBitmap(hInstance, 'my_bitmap_id');
0
 
LVL 4

Expert Comment

by:alikoank
ID: 11760584
there is also a nice article about embedding resources into executables at:

http://www.howtodothings.com/showarticle.asp?article=288
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

604 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