我找到了一個從資源文件加載位圖的解決方案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