官术网_书友最值得收藏!

Sharing photos

FireMonkey's basic sharing service does not differ from the way we interact to take a photo; that is, we can use a standard action in our ActionList1 to create a new event where we share the photo you just took.

Now that our application is responsive and is properly recording the most important moments through photographs, let's share! Using the same example from previous recipes, we will now develop the button event we created with the SVG icon.

The following steps will show you how to share the photos using FireMonkey:

  1. Create a new action in the ActionList1, in the Media Library category, to display the share center. Select the ShowShareSheetAction1 action:
  1. The event is now different; in order to share, it is necessary to assign what you want to share. In our project, we will share a photo. For this, we must program the OnBeforeExecute event of this action:

The following is the code for the OnBeforeExecute event:

procedure TForm1.ShowShareSheetAction1BeforeExecute(Sender: TObject);
begin
ShowShareSheetAction1.Bitmap.Assign(ImgInsta.Bitmap);
end;
  1. Now, to finish, just assign the newly coded action the Action property of our button. You can use Structure pane and select the TSpeedButton (which has the TPath component is inside it) component with the Instagram logo. With everything ready, when taking a photo it will be filled through the TImage component that can be shared.

The following screenshot shows the form view at development time:

The following screenshot shows the form view running on an Android mobile:

Finally, the application images are still at design time in Delphi and are already running on an Android device.

主站蜘蛛池模板: 虹口区| 合山市| 宝兴县| 西乌珠穆沁旗| 峨眉山市| 尼玛县| 庆阳市| 黔西| 凤城市| 三明市| 顺昌县| 长垣县| 平利县| 安多县| 濮阳市| 阿巴嘎旗| 包头市| 博湖县| 阳泉市| 文登市| 孝昌县| 达日县| 乌兰县| 阿坝县| 阿图什市| 泾源县| 贡嘎县| 平山县| 邢台市| 昌图县| 南宁市| 金乡县| 永泰县| 威宁| 廉江市| 泗阳县| 泽库县| 兴山县| 大埔区| 塔河县| 西乡县|