diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_animation.pas | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/fpg_animation.pas b/src/gui/fpg_animation.pas index 36972877..ff58f755 100644 --- a/src/gui/fpg_animation.pas +++ b/src/gui/fpg_animation.pas @@ -31,6 +31,8 @@ uses type + { TfpgBaseImgAnim } + TfpgBaseImgAnim = class(TfpgWidget) private FFrameCount: integer; @@ -58,6 +60,8 @@ type public constructor Create(AOwner: TComponent); override; destructor Destroy; override; + + procedure ImageFromByte(ABmp: Pointer; ASize: longword); end; @@ -161,6 +165,24 @@ begin Repaint; end; +procedure TfpgBaseImgAnim.ImageFromByte(ABmp: Pointer; ASize: longword); +begin + if ABmp=nil then + Exit; + + FTimer.Enabled := False; + FImage.Free; + FImage := CreateImage_BMP(ABmp, ASize); + if FTransparent then + begin + FImage.CreateMaskFromSample(0, 0); + FImage.UpdateImage; + end; + FImageFilename := 'byte'; // because handle paint check if file is set + RecalcImageWidth; + Repaint; +end; + constructor TfpgBaseImgAnim.Create(AOwner: TComponent); begin inherited Create(AOwner); |