[Solved] how to load a default image in a tpicture property of a component lazarus / 31-LCL ---------------------------------------------------------------------- Jurassic Pork · 2013-05-19 16:45 I have a new visual  component with some Tpicture properties. By Default if i put this component in a form, the Tpicture properties are empty. Then  i can load the tpicture properties with the picture editor. But how to load by default a picture which is a resource file before i use the picture editor and before i compile the form ? ---------------------------------------------------------------------- Blaazen · 2013-05-19 18:18 You can have a file in resources (*.lrs), for example in PNG format. You can use such code: Code: [Select]class constructor TMyComponent.LoadGlyph; begin   {$I project1.lrs}   Glyph := TPortableNetworkGraphic.Create;   Glyph.LoadFromLazarusResource('glyphname');  end;Glyph is a class var and LoadGlyph is class constructor, it makes no sense to load the same glyph for each instance of your component. You can normally draw the glyph using Canvas.Draw(x, y, Glyph); in Paint method (or maybe elsewhere). You can create resource file using tool lazres which comes bundled with Lazarus. ---------------------------------------------------------------------- Jurassic Pork · 2013-05-20 05:29 thanks for your help,  finally i have found a delphi component which do what i want to do. I try to convert it to Lazarus. It seems that it will not be too hard.