Modify Delphi FMX code to take the bitmap from a timage and send the image to androids gallery.
$10-30 USD
Cerrado
Publicado hace más de 5 años
$10-30 USD
Pagado a la entrega
procedure [login to view URL](Sender: TObject);
var
Intent: JIntent;
FileName, DestFileName: string;
Data: Jnet_Uri;
CompName: JComponentName;
lFile: JFile;
const
IMAGE_FILENAME = '[login to view URL]';
// need to get the bitmap in a timage and use this intent to open it in androids gallery.
begin
FileName := [login to view URL] + PathDelim + IMAGE_FILENAME;
// deployed to "assets"
log.d(FileName);
DestFileName := [login to view URL] + PathDelim + IMAGE_FILENAME;
[login to view URL](FileName, DestFileName, true);
Intent := [login to view URL];
[login to view URL](TJIntent.JavaClass.ACTION_VIEW);
if TJBuild_VERSION.JavaClass.SDK_INT >= TJBuild_VERSION_CODES.JavaClass.N then
begin
lFile := [login to view URL](StringToJString(FileName));
[login to view URL](TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION);
Data := [login to view URL]([login to view URL],
StringToJString('[login to view URL]'), lFile);
end
else
Data := [login to view URL]
(StringToJString('file://' + DestFileName));
[login to view URL](Data, StringToJString('image/jpg'));
try
[login to view URL](Intent);
except
on E: Exception do
begin
[login to view URL] := [login to view URL];
end;
end;
end;
I have a timage on a form. It has a bitmap in it.
I need to get the image from the timage and use this intent to send the image to androids gallery/photos.