Re: Add my own bitmaps into a resource file?



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
.



Relevant Pages

  • Re: VB3 is making my head spin!
    ... > and displaying it pixel by pixel] tell me how. ... compressed bitmap from an original 24 but full colour bitmap that is held on disk as a standard ... It shows you how to load a full colour 24bit .bmp file from disk and count ... Dim z As Long, t1 As Long, t2 As Long ...
    (comp.lang.basic.visual.misc)
  • Re: Loading image byte array
    ... Thanks Frank, I actually got it working myself before I saw your code. ... load the my image like Michael Phillips suggested. ... at that point Then create a Graphics using a fast-access second bitmap (we ... by pixel over to the byte array. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: ImageList: Is this possible?
    ... Now I want to load ... There's an API fiunction that lets you create a bitmap in memory: ... lpInfoHeader As BITMAPINFOHEADER, ByVal dwUsage As Long, lpInitBits As ...
    (microsoft.public.vb.general.discussion)
  • Re: Large image
    ... The problem there is just trying to load a 3000x3000 bitmap is very likely ... to run the device out of memory long before it's fully in memory. ... templates and full source code then you can buy the SDF Extensions ...
    (microsoft.public.dotnet.framework.compactframework)
  • Twain and Stream questions
    ... load it back from the file into my image control no problem. ... into/out of a stream. ... any ideas on how to load the bitmap directly ... internal static extern int GdipSaveImageToStream(IntPtr image, ...
    (microsoft.public.dotnet.languages.csharp)