我找到了一个从资源文件加载位图的解决方案How to store images in FireMonkey?我试图在我的Firemonkey应用程序中使用它,但它找不到资源并引发错误“EresNotFound”。 我的资源.RC文件是这样的从资源加载位图
Bitmap_1 BITMAP "Test.bmp"
和我的代码是
procedure Tform1.load_image_from_resource(var Im1: Timage; res_name: String);
var InStream: TResourceStream;
begin
InStream := TResourceStream.Create(HInstance, res_name,RC_RTDATA);
try
Im1.Picture.Bitmap.LoadFromStream(InStream);
finally
InStream.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Load_image_from_resource(Image1,'Bitmap_1');
end;
我也发现了这个问题Delphi 2010: unable to find resource - EResNotFound的解决方案。 但它仍然没有找到林资源
你读这篇文章https://delphihaven.wordpress.com/2013/01/26/surviving-without-image-lists-in- fmx /并遵循了从那里开始的所有步骤? – RBA