Delphi PNG images collection in a component

Viewed 1209

today my question is about creating a collection of PNG images in a component. I found a button that accept a PNG image as a gliph, but it use a PNG image composed by the four states of the image like this:

enter image description here

I've modified the component for using four differents images, each one for a single state. So, my components looks like this:

  ...
  public
    FPngImgEnabled: TPngImage;
    FPngImgDisabled: TPngImage;
    FPngImgDown: TPngImage;
    FPngImgOver: TPngImage;
    FDown: Boolean;
    Constructor Create(AOwner: TComponent); override;
    Destructor Destroy; override;
    procedure Paint; override;
  published
    property PngImgEnabled: TPngImage read FPngImgEnabled write SetPngImgEnabled;
    property PngImgDisabled: TPngImage read FPngImgDisabled write SetPngImgDisabled;
    property PngImgDown: TPngImage read FPngImgDown write SetPngImgDown;
    property PngImgOver: TPngImage read FPngImgOver write SetPngImgOver;
  ...

Is this way I've a component with four PNG images and then for SetPng... procedures. I wonder if there is a way to use a collection of the four PNG images; something like "TPNGImagesList" for concentrate the images in a single place.

1 Answers
Related