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

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.

主站蜘蛛池模板: 天镇县| 宁乡县| 田东县| 汝城县| 政和县| 邵阳市| 西吉县| 建昌县| 章丘市| 赤峰市| 太白县| 揭西县| 抚顺县| 迁西县| 商水县| 乃东县| 鄂尔多斯市| 石城县| 晋城| 盐边县| 容城县| 太谷县| 庆安县| 潮州市| 凭祥市| 舞钢市| 霍林郭勒市| 鱼台县| 土默特右旗| 广丰县| 成武县| 襄垣县| 阿克陶县| 什邡市| 宿松县| 赤城县| 新丰县| 密云县| 清新县| 青河县| 五原县|