Difference between revisions of "lazres"

From Free Pascal wiki
Jump to navigationJump to search
m (Fixed syntax highlighting; deleted category included in page template)
Line 1: Line 1:
{{Warning|The current development (trunk) version of Lazarus has switched to .res format instead of .lrs; see [[Lazarus_1.4.0_release_notes]] }}
+
{{lazres}}
 +
 
 +
{{Warning|Since Lazarus v1.4.0, Lazarus has switched to .res format instead of .lrs; see [[Lazarus_1.4.0_release_notes]] }}
  
 
'''lazres''' is a lazarus resource tool to create and convert <tt>.rc</tt>, <tt>.lrs</tt> and <tt>.res</tt> files.
 
'''lazres''' is a lazarus resource tool to create and convert <tt>.rc</tt>, <tt>.lrs</tt> and <tt>.res</tt> files.
Line 25: Line 27:
  
 
=== .lrs ===
 
=== .lrs ===
 +
 
Include .res file in the initialization section
 
Include .res file in the initialization section
  
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
initialization
 
initialization
 
   // .LRS files are plain-text pascal statements and need unit LResources to be included
 
   // .LRS files are plain-text pascal statements and need unit LResources to be included
Line 35: Line 38:
  
 
=== .res ===
 
=== .res ===
 +
 
Load .res file in the implementation section
 
Load .res file in the implementation section
 
   
 
   
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
 
implementation
 
implementation
 
   // .RES files are binary resources and can be loaded
 
   // .RES files are binary resources and can be loaded
 
  {$R MyResources.res}
 
  {$R MyResources.res}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
[[Category:Tools]]
 

Revision as of 01:57, 19 February 2020

Deutsch (de) English (en)

Warning-icon.png

Warning: Since Lazarus v1.4.0, Lazarus has switched to .res format instead of .lrs; see Lazarus_1.4.0_release_notes

lazres is a lazarus resource tool to create and convert .rc, .lrs and .res files.

Lazres can be found as <root>/lazarus/tools/lazres.lpi and needs to be compiled.

Usage: lazres resourcefilename filename1[=resname1] [filename2[=resname2] ... filenameN=resname[N]]
       lazres resourcefilename @filelist

To create a resource file MYRES.RES with two .png graphics files use:

lazres MYRES.RES MyPng1.png=TIMG1 MyPng2.png=TIMG1

A resource file can be of type:

.RC resource description file plaintext
.LRS lazarus (pascal) resource plaintext default
.RES compiled resource binary


Using resources

.lrs

Include .res file in the initialization section

initialization
  // .LRS files are plain-text pascal statements and need unit LResources to be included
 {$I MyResources.lrs}
end.

.res

Load .res file in the implementation section

implementation
  // .RES files are binary resources and can be loaded
 {$R MyResources.res}