private static async void SetImage(UIBarItem uiButton, ImageSource source) { uiButton.Image = await source.GetImageAsync(); }
public async Task<string> GetBase64FromImageSource(ImageSource imageSource, ImageType imageType = ImageType.Jpeg) { var image = await imageSource.GetImageAsync(); switch (imageType) { case ImageType.Jpeg: return image.AsJPEG(0.75f).GetBase64EncodedString(NSDataBase64EncodingOptions.None); case ImageType.Png: return image.AsPNG().GetBase64EncodedString(NSDataBase64EncodingOptions.None); } return null; }
private static async void SetImage(UIButton uiButton, ImageSource source) { uiButton.SetImage(await source.GetImageAsync(), UIControlState.Normal); }
public async Task<ImageSource> GetProcessedImageSourceAsync(ImageSource imageSource, ImageOptions options) { var uiImage = await imageSource.GetImageAsync(); return ProcessImageSource(options, uiImage); }