diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-03-06 12:11:22 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-03-06 12:11:22 +0200 |
| commit | 99715aa1c659a3d5d7709cb16d5dfe1b1c29a135 (patch) | |
| tree | d003fe1c07117036039294ffc8b6ba51096938d4 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ByteArrayToBitmapSourceConverter.cs | |
| parent | ce68bf700e2e6535e1ed155fe2806c1ed6030edd (diff) | |
| parent | 7e6c673cc8b04086fa3c78cd1bf5e31085fd8cc8 (diff) | |
| download | Tango-99715aa1c659a3d5d7709cb16d5dfe1b1c29a135.tar.gz Tango-99715aa1c659a3d5d7709cb16d5dfe1b1c29a135.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ByteArrayToBitmapSourceConverter.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ByteArrayToBitmapSourceConverter.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ByteArrayToBitmapSourceConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ByteArrayToBitmapSourceConverter.cs new file mode 100644 index 000000000..d839b0060 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ByteArrayToBitmapSourceConverter.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.Developer.Converters +{ + public class ByteArrayToBitmapSourceConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + byte[] bytes = value as byte[]; + if (bytes != null) + { + return bytes.ToBitmapSource(); + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} |
