C# 如何以FileImageSource格式制作图像?

C# 如何以FileImageSource格式制作图像?,c#,xamarin,xamarin.forms,C#,Xamarin,Xamarin.forms,我有一张图片要作为文件存储在数据库中,所以我想我必须使用FileImageSource将其转换为正确的格式 这是我的代码: imgPicked.Source = FileImageSourceConverter; ??? 如何将imgPicked(xaml中的图像)转换为fileimagesource 更新: 数据库 static public async Task<bool> createData (string userId, FileImageSource thePictur

我有一张图片要作为文件存储在数据库中,所以我想我必须使用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);

 }

ImageSource是告诉表单使用源中的图像的方式;它只有一种作用。如果要存储图像,首先要存储用于创建ImageSource的数据(文件、url、流等)。请检查更新后的帖子,因此,当我尝试创建它时,现在出现了错误:无法将“Xamarin.Forms.image”表达式转换为“Xamarin.Forms.FileImageSource”类型屏幕上显示的图像是图像控件。不能将其存储在数据库中。您需要存储最初用于创建图像的ImageSource.ok的文件(或流、url等)。所以我必须将其存储为图像或ImageSource,而不是fileimagesource?如果某个东西发生了变化,我会将其存储为解析中的“文件”。我尝试将其存储为图像和图像源,但无法使其正常工作。您最初从何处获取显示的jpeg?无论数据来自何处,都是要存储在数据库中的数据。
          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"
         }