Windows resource file (.res) in Lazarus lazarus / 8-Other ---------------------------------------------------------------------- Phil H. · 2005-08-09 18:16 How do I work with a .res file containing several bitmaps in Lazarus? LazRes converts forms to Lazarus resources, but what's the trick for .res files so I can load their bitmaps with TBitMap.LoadFromLazarusResource? ---------------------------------------------------------------------- Marc · 2005-08-10 09:20 You cannot platform independent. On win32 you can link it to your executable and use the winapi functions for it. ---------------------------------------------------------------------- Phil H. · 2005-08-10 14:38 Quote from: "Marc"You cannot platform independent. On win32 you can link it to your executable and use the winapi functions for it. Marc, thanks for the info, but there are a couple of problems with that approach. FPC will only link in one .res file with the {$R} directive. If I have two in a project, then the Win API LoadBitmap returns 0, indicating it didn't find the bitmap resource. If I comment out the {$R} in my .lpr that links in the program's icon and version info (generated by Delphi), then LoadBitmap works (returns non-0 handle of the bitmap). However, assigning this to an LCL TBitmap.Handle doesn't work like it does in Delphi. Is there some trick to getting a loaded bitmap handle to work with LCL's TBitmap? Also, is there a cross-platform way of working with bitmaps? For example, can I convert the .res bitmaps to some format that can work with LCL? I believe this .res file was created with Delphi's Image Editor. Thanks. -Phil ---------------------------------------------------------------------- Marc · 2005-08-11 08:55 You can use it as lazresource (in the tools dir) Usage: lazres resourcefilename filename1 [filename2 ... filenameN] Example:   lazres mybitmaps bitmap1.bmp bitmap2.bmp would create a mybitmaps.lrs whith 2 resources of type bmp with the name bitmap1 and bitmap2 See the unit LResources for more info. ---------------------------------------------------------------------- Phil H. · 2005-08-11 17:29 Quote from: "Marc"You can use it as lazresource (in the tools dir) Usage: lazres resourcefilename filename1 [filename2 ... filenameN] Example:   lazres mybitmaps bitmap1.bmp bitmap2.bmp would create a mybitmaps.lrs whith 2 resources of type bmp with the name bitmap1 and bitmap2 See the unit LResources for more info. Marc, many thanks. I'll give that a try. -Phil