Mega Code Archive

 
Categories / Delphi / Examples
 

Loading your glyphs from resources

If you want static bitmaps in your forms and the users are not allowed to change them you can use a RES file instead of loading Bitmaps in the Delphi IDE. This also makes your EXE smaller! Example: Unit Unit1; Interface Uses x,y,z; Type ... Implementation {$R BitIco.res} ... procedure ... begin // Watch out for upper and lower case Image1.Picture.Bitmap.Handle := LoadBitmap(HInstance, 'Name of Bitmap'); // or: Image1.Picture.Icon.Handle := LoadIcon(HInstance, 'Name of Icon'); ... end; Don't forget that the names are treated case-sensitive!