Browse Source

load from any resource

Johann ELSASS 5 years ago
parent
commit
4ef49068e6
1 changed files with 10 additions and 2 deletions
  1. 10 2
      bgraspriteanimation.pas

+ 10 - 2
bgraspriteanimation.pas

@@ -547,8 +547,16 @@ begin
 end;
 
 procedure TBGRASpriteAnimation.LoadFromBitmapResource(const Resource: string);
-begin
-  LoadFromResourceName(HInstance, Resource);
+var
+  tempGif: TBGRAAnimatedGif;
+begin
+  tempGif := TBGRAAnimatedGif.Create;
+  try
+    tempGif.LoadFromResource(Resource);
+    GifImageToSprite(tempGif);
+  finally
+    tempGif.Free;
+  end;
 end;
 
 procedure TBGRASpriteAnimation.LoadFromBGRABitmap(const BGRA: TBGRABitmap);