Download Now

    Reference TImageStrip

    Declared in Codebot.Graphics.pas on line 155

    TImageStrip is a series of images of the same height and width
      TImageStrip = class(TComponent)
      protected
        procedure ReadData(Stream: TStream);
        procedure WriteData(Stream: TStream);
        procedure DefineProperties(Filer: TFiler); override;
        { Notify component subscribers of changes }
        procedure Change; virtual;
      public
        { Create an empty image strip }
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        { Copy the images of another image strip }
        procedure Assign(Source: TPersistent); override;
        { Suspend change notifications until EndUpdate is called }
        procedure BeginUpdate;
        { Resume change notifications }
        procedure EndUpdate;
        { Colorize the underlying bitmap }
        procedure Colorize(Color: TColorB);
        { Copy the underlying bitmap object }
        procedure CopyTo(Bitmap: IBitmap);
        { Resample each image to a square size using best quality }
        procedure Resample(Size: Integer);
        { Load a series of images }
        procedure LoadRange(const Files: TStrings);
        { Load an image list from a file }
        procedure LoadFromFile(const Filename: string);
        { Load an image list from a stream }
        procedure LoadFromStream(Stream: TStream);
        { Save an image list to a file }
        procedure SaveToFile(const Filename: string);
        { Save an image list to a stream }
        procedure SaveToStream(Stream: TStream);
        { Draw an image at a point, optionally using a draw state to dim disabled
          images, or into a rect with opacity and saturation }
        procedure Draw(Surface: ISurface; Index: Integer; X, Y: Integer); overload;
        procedure Draw(Surface: ISurface; Index: Integer; X, Y: Integer; State: TDrawState); overload;
        procedure Draw(Surface: ISurface; Index: Integer; const Rect: TRectI; Opacity: Byte = $FF; Saturation: Float = 1.0); overload;
        { Add an image to the end }
        procedure Add(Image: IBitmap); overload;
        procedure Add(Image: TSurfaceBitmap); overload;
        { Insert an image at an index }
        procedure Insert(Image: TSurfaceBitmap; Index: Integer);
        { Remove an image }
        procedure Remove(Index: Integer);
        { Move an image to a new index }
        procedure Move(OldIndex, NewIndex: Integer);
        { Remove all images }
        procedure Clear;
        { The number of images }
        property Count: Integer read GetCount;
        { The width and height of each image }
        property Size: Integer read GetSize;
        { Allow component subscribers to add or remove change notification }
        property OnChange: INotifyDelegate read GetOnChange;
      end;

    See also

    Float in Codebot.System.pas
    IBitmap in Codebot.Graphics.Types.pas
    INotifyDelegate in Codebot.System.pas
    ISurface in Codebot.Graphics.Types.pas
    TColorB in Codebot.Graphics.Types.pas
    TDrawState in Codebot.Graphics.Types.pas
    TRectI in Codebot.Graphics.Types.pas