Lazarus Custom Drawn Package

From Lazarus wiki


The package customdrawn.lpk is an under construction package containing all kinds of custom drawn components for Lazarus. Read more about it in Lazarus Custom Drawn Controls.


  • Can be fully reliable in look, behavior and size across platforms
  • Customizable look (skinnable in a reliable and cross-platform way)
  • Ability to mix native and custom drawn controls. This is major difference with with using [fpGUI] or the [fpGUI Interface]: it can't mix native and ownerdrawn (fpgui) components in one application.
  • They can be utilized in LCL interfaces if the native controls are too unreliable or if no native control exists or if the native controls cannot be used in a convinient way (because they are written in Java, for example)



See Lazarus Custom Drawn Controls


The control helps implementing an user interface which has buttons with an unusual look, such as is often found in games. The appearance of the button is defined by a set of raster images which are displayed for each state of the button, such as normal, focused, down.

Location of the code in Lazarus:

Usage example:

uses customdrawnextras;

  ActionButton: TBitmappedButton;
  ActionButton := TBitmappedButton.Create(Self);
  ActionButton.Options := [bboUseImageForSelection];
  ActionButton.TabStop := True;
  ActionButton.OnClick := HandleActionButtonClick;
  ActionButton.Tag := i;
  ActionButton.Font.Size := 12;
  ActionButton.Font.Name := 'Times New Roman';
  ActionButton.Font.Color := clWhite;
  ActionButton.Parent := Self;
  ActionButton.Visible := True;
  ActionButton.Height := GetSkins().GetButton(sbSmall).Height;
  ActionButton.Width := GetSkins().GetButton(sbSmall).Width;
  ActionButton.Left := lLeft;
  ActionButton.Top := lTop;
  ActionButton.Caption := FModel.ActionButtons[i].Caption;


See Also