[Proposal] `byte[]`-to-`ImageSource` Converter
See original GitHub issueByteArrayToImageSourceConverter
- Proposed
- Prototype
- Implementation
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests
- Sample
- Documentation
Summary
The ByteArrayToImageSourceConverter
is a Converter
that allows the user to convert an incoming value from byte[]
and returns an ImageSource
. This object can then be used as the Source of an Image control.
Detailed Design
Usage Syntax
XAML Usage
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="MyLittleApp.MainPage">
<ContentPage.Resources>
<ResourceDictionary>
<xct:ByteArrayToImageSourceConverter x:Key="ByteArrayToImageSourceConverter" />
</ResourceDictionary>
</ContentPage.Resources>
<StackLayout>
<Image Source="{Binding MyByteArray, Converter={StaticResource ByteArrayToImageSourceConverter}}" />
</StackLayout>
</ContentPage>
C# Usage
class MyPage : ContentPage
{
public MyPage()
{
Content = new Image().Bind(Image.SourceProperty, named(ViewModel.MyByteArray), converter: new ByteArrayToImageSourceConverter());
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
byte-array-to-image-source-converter.md
The ByteArrayToImageSourceConverter is a converter that allows the user to convert an incoming value from a byte array and returns an ...
Read more >ByteArrayToImageSourceConver...
The ByteArrayToImageSourceConverter is a converter that allows the user to convert an incoming value from a byte array and returns an ...
Read more >c# - Byte array to image conversion
I want to convert a byte array to an image. This is my database code from where I get the byte array: public...
Read more >How to convert the byte array into an image file - NI Community
Hi. Now i'm working on convert the byte array into an image file. I have to use Labview coms so cannot use graphic...
Read more >ImageSource(Boolean, Byte[]) Constructor
Initializes a new instance of the ImageSource class with specified settings. Namespace: DevExpress.XtraPrinting.Drawing. Assembly: DevExpress.Printing.v23.1.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know we talked about the tests being completed, but I noticed there weren’t any for
ConvertBack
, so I wrote a few and submitted PR #197Reopening Proposal.
Only Proposals moved to the
Closed
Project Column andCompleted
Project Column can be closed.