FMX.MediaLibrary.IFMXPhotoLibrary.AddImageToSavedPhotosAlbum

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure AddImageToSavedPhotosAlbum(const ABitmap: TBitmap; const AWriteImageCompletionEvent: TWriteImageCompletionEvent = nil);

C++

virtual void __fastcall AddImageToSavedPhotosAlbum(Fmx::Graphics::TBitmap* const ABitmap, const TWriteImageCompletionEvent AWriteImageCompletionEvent = 0x0) = 0 ;

Properties

Type Visibility Source Unit Parent
procedure
function
public
FMX.MediaLibrary.pas
FMX.MediaLibrary.hpp
FMX.MediaLibrary IFMXPhotoLibrary

Description

Saves a bitmap image to the photo library of the device.

AddImageToSavedPhotosAlbum accepts the following parameters:

  • ABitmap: The bitmap image to save.
  • AWriteImageCompletionEvent: The callback method you can use to confirm if the image is saved.

AddImageToSavedPhotosAlbum saves the pictures to an album in the photo library of the device. The name of the album depends on the operating system of the device:

Operating System Album Name

iOS

Camera Roll

Android

Saved Photos

Saving an Image to the Device Photo Album

To demonstrate the use of the AddImageToSavedPhotosAlbum method, consider the following code snippet:

Delphi:

procedure TForm1.Image1Click(Sender: TObject);
begin
  if TPlatformServices.Current.SupportsPlatformService(IFMXPhotoLibrary, Service) then
    Service.AddImageToSavedPhotosAlbum(Image1.Bitmap)
  else
    ShowMessage('The IFMXPhotoLibrary interface is not supported.');
end;

C++:

void __fastcall TForm1::Image1Click(TObject *Sender)
{
	if (TPlatformServices::Current->SupportsPlatformService(__uuidof(IFMXPhotoLibrary), &Service)) {
	   Service->AddImageToSavedPhotosAlbum(Image1->Bitmap);
	}
	else {
		ShowMessage("The IFMXPhotoLibrary interface is not supported.");
	}
}

Platform Support

Platform Supported

iOS

YesC++11Feature.png

Windows

Android

YesC++11Feature.png

OS X

See Also

Code Samples