Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimonovdd/ImageFromXamarinUI
Extension methods for capturing images from UI
https://github.com/dimonovdd/ImageFromXamarinUI
image screenshot ui xamarin xamarin-forms
Last synced: 30 days ago
JSON representation
Extension methods for capturing images from UI
- Host: GitHub
- URL: https://github.com/dimonovdd/ImageFromXamarinUI
- Owner: dimonovdd
- License: mit
- Created: 2021-01-22T18:34:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T21:01:08.000Z (over 3 years ago)
- Last Synced: 2024-11-03T08:37:12.931Z (about 1 month ago)
- Topics: image, screenshot, ui, xamarin, xamarin-forms
- Language: C#
- Homepage:
- Size: 637 KB
- Stars: 37
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xamarin-forms - ImageFromXamarinUI ★30
README
# ImageFromXamarinUI [![NuGet Badge](https://img.shields.io/nuget/vpre/ImageFromXamarinUI)](https://www.nuget.org/packages/ImageFromXamarinUI/) [![NuGet downloads](https://img.shields.io/nuget/dt/ImageFromXamarinUI)](https://www.nuget.org/packages/ImageFromXamarinUI/) [![license](https://img.shields.io/github/license/dimonovdd/ImageFromXamarinUI)](https://github.com/dimonovdd/ImageFromXamarinUI/blob/main/LICENSE) [![ImageFromXamarinUI on fuget.org](https://www.fuget.org/packages/ImageFromXamarinUI/badge.svg)](https://www.fuget.org/packages/ImageFromXamarinUI) [![YouTube Video Views](https://img.shields.io/youtube/views/O9D3NSYh1t0?style=social)](https://youtu.be/O9D3NSYh1t0)
### Extension methods for capturing images from UI![header](/header.svg)
## Available Platforms:
| Platform | Version |
| --- | --- |
| Android | MonoAndroid90+|
| iOS | Xamarin.iOS10 |
| .NET Standard | 2.0 |## Getting started
You can just watch the [Video](https://youtu.be/O9D3NSYh1t0) that [@jfversluis](https://github.com/jfversluis) published
This is how you can create a simple command to call `CaptureImageAsync` method
```csharp
public ImageSource ResultImageSource { get; set; }public ICommand CaptureCommand => new Command(OnCapture);
async void OnCapture(Xamarin.Forms.VisualElement element)
{
try
{
var stream = await element.CaptureImageAsync(Color.White);
ResultImageSource = ImageSource.FromStream(() => stream);
}
catch (Exception)
{
// Handle exception
}
}
```
You can pass in the calling element when the `Command` is triggered:
```xml
```