Re: Add my own bitmaps into a resource file?
- From: Kent Briggs <kbriggs@xxxxxxxxxxx>
- Date: Sun, 16 Sep 2007 16:14:29 -0500
Somebody wrote:
Hello,
I want to use a resource file to load my own bitmaps. Previously I have been using loadfromfile but want to get away from that.
However, I can set up the resource file but it only appears to let me create a new bitmap. I already have some ready but just can't see the option to add them. Is it possible? Thanks.
Create a text file with an .rc extension. Then add that file with Project|Add File in the Delphi IDE. The contents of the .rc file look like this:
Image1 BITMAP Image1.bmp
Image2 BITMAP Image2.bmp
Then load those in your code like this:
MyBitmap:=TBitmap.Create;
MyBitmap.LoadFromResourceName(hInstance,'Image1');
--
Kent Briggs, kbriggs@xxxxxxxxxxx
Briggs Softworks, http://www.briggsoft.com
.
- References:
- Add my own bitmaps into a resource file?
- From: Somebody
- Add my own bitmaps into a resource file?
- Prev by Date: Re: Add my own bitmaps into a resource file?
- Next by Date: Re: Add my own bitmaps into a resource file?
- Previous by thread: Re: Add my own bitmaps into a resource file?
- Next by thread: Re: Add my own bitmaps into a resource file?
- Index(es):
Relevant Pages
|