WebImageControl "LoadFromBase64" not found

Hello TMS Team,
i take a picture and want to load and show the picture in a "WebImageControl".
But I get the compiler error:
[Error] pm_start.pas(190): identifier not found "LoadFromBase64"

Here is a code snippet:

procedure TstartForm.wfpPictureChange(Sender: TObject); // webFilePicker change
begin
picLoaded:=false;
if wfpPicture.Files.Count>0 then
wfpPicture.Files[0].GetFileAsBase64;
end;

procedure TstartForm.wfpPictureGetFileAsBase64(Sender: TObject; AFileIndex: Integer; ABase64: string);
begin
wicPicture.Picture.LoadFromBase64(aBase64); // ERROR: "LoadFormBase64" not found ???
end;

procedure TstartForm.wfpPictureUploadFileComplete(Sender: TObject;
AFileIndex: Integer);
begin
ShowMessage('Datei geladen');
end;

WebImageControl.Picture is of the type TURLPicture and this class TURLPicture has no method LoadFromBase64.
It has a property though Picture.LoadFromURL() and you could use a base64 data URL.
Just set the prefix data:image/png;base64 before the BASE64STRING, like in:

data:image/png;base64,BASE64STRING

Thank you Bruno,
I have change my source and it works now.

Best regards

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.