如何以FileImageSource格式制作图像?

时间:2016-01-03 00:28:00

标签: c# xamarin xamarin.forms

我有一张图片,我想将其作为文件存储在我的数据库中,所以我想我必须使用FileImageSource将其格式化为正确的格式。

这是我的代码:

imgPicked.Source = FileImageSourceConverter; ???

如何将imgPicked(我的xaml中的图像)制作成fileimagesource?

更新

数据库;

static public async Task<bool> createData (string userId, FileImageSource thePicture )

    {
        var httpClientRequest = new HttpClient ();

        httpClientRequest.DefaultRequestHeaders.Add ("X-Parse-Application-Id", appId);
        httpClientRequest.DefaultRequestHeaders.Add ("X-Parse-REST-API-Key", apiKey);

        var postData = new Dictionary <object, object> ();

        postData.Add ("Owner", userId);
        postData.Add ("thePicture", thePicture);

 }

数据库中的CreateImage;

          void Click (object sender, Eventargs args)
         {
         var createResult = await parseAPI.createData 
            (Application.Current.Properties ["userId"].ToString (), imgPicked); 
//imgPicked (xaml image) gives me an error: Cannot convert "Xamarin.Forms.Image" expression to type "Xamarin.Forms.FileImageSource"
         }

0 个答案:

没有答案