Пример #1
0
        void _pickImage()
        {
            var imageUrl  = this.widget.urls[this.currentIndex];
            var imagePath = SQLiteDBManager.instance.GetCachedFilePath(imageUrl);

            if (imagePath.isEmpty())
            {
                return;
            }

            var items = new List <ActionSheetItem> {
                new ActionSheetItem(
                    "保存图片",
                    onTap: () => {
                    if (imagePath.isNotEmpty())
                    {
                        var imageStr = CImageUtils.readImage(imagePath);
                        PickImagePlugin.SaveImage(imagePath, imageStr);
                    }
                }
                    ),
                new ActionSheetItem("取消", type: ActionType.cancel)
            };

            ActionSheetUtils.showModalActionSheet(new ActionSheet(
                                                      title: "",
                                                      items: items
                                                      ));
        }
Пример #2
0
        void _pickImage()
        {
            var items = new List <ActionSheetItem> {
                new ActionSheetItem(
                    "拍照",
                    onTap: () => PickImagePlugin.PickImage(
                        source: ImageSource.camera,
                        pickImage => {
                    this._pickedImage = Convert.ToBase64String(inArray: pickImage);
                    this.setState(() => { });
                },
                        maxSize: 100 * 1024
                        )
                    ),
                new ActionSheetItem(
                    "从相册选择",
                    onTap: () => PickImagePlugin.PickImage(
                        source: ImageSource.gallery,
                        pickImage => {
                    this._pickedImage = Convert.ToBase64String(inArray: pickImage);
                    this.setState(() => { });
                },
                        maxSize: 100 * 1024
                        )
                    ),
                new ActionSheetItem("取消", type: ActionType.cancel)
            };

            ActionSheetUtils.showModalActionSheet(new ActionSheet(
                                                      title: "修改头像",
                                                      items: items
                                                      ));
        }
Пример #3
0
        void _pickImage()
        {
            var items = new List <ActionSheetItem> {
                new ActionSheetItem(
                    "拍照",
                    onTap: () => PickImagePlugin.PickImage(
                        source: ImageSource.camera,
                        pickImage => {
                    this._pickedImage = pickImage;
                    this.setState(() => { });
                }
                        )
                    ),
                new ActionSheetItem(
                    "从相册选择",
                    onTap: () => PickImagePlugin.PickImage(
                        source: ImageSource.gallery,
                        pickImage => {
                    this._pickedImage = pickImage;
                    this.setState(() => { });
                }
                        )
                    ),
                new ActionSheetItem("取消", type: ActionType.cancel)
            };

            ActionSheetUtils.showModalActionSheet(new ActionSheet(
                                                      title: "修改头像",
                                                      items: items
                                                      ));
        }