Sharing your pictures
Almost every mobile app has some way of sharing pictures and text on social media services, through file-sharing sites and as attachments in text messages or emails. It's been made super-simple to do so in your Delphi app by simply using another one of the standard actions similar to taking a photo. From the action list in your app, add a new standard action and select TShowShareSheetAction
in the Media Library section. Assign it to a new button in the toolbar at the bottom of tabParkEdit
.
We'll hook into just one of the events, OnBeforeExecute
, which lets us set up what we're going to share, as follows:
procedure TfrmMyParksMain.ShowShareSheetActionBeforeExecute(Sender: TObject); begin ShowShareSheetAction.Bitmap := imgParkPic.Bitmap; ShowShareSheetAction.TextMessage := Format('%s (%0.5f, %0.5f)', ...