Click or drag to resize

WpfConverter Class

This is a static class used to convert an AtalaImage to a BitmapSource and back.
Inheritance Hierarchy
SystemObject
  Atalasoft.Imaging.WpfWpfConverter

Namespace:  Atalasoft.Imaging.Wpf
Assembly:  Atalasoft.dotImage.Wpf (in Atalasoft.dotImage.Wpf.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public static class WpfConverter

The WpfConverter type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAtalaImageToBitmapSource
Converts an AtalaImage to a BitmapSource.
Public methodStatic memberAtalaToWpfPixelFormat
Converts an Atalasoft.Imaging.PixelFormat to a System.Windows.Media.PixelFormat equivalent.
Public methodStatic memberBitmapSourceToAtalaImage
Converts a BitmapSource to an AtalaImage.
Public methodStatic memberWpfToAtalaPixelFormat
Converts an System.Windows.Media.PixelFormat to a Atalasoft.Imaging.PixelFormat equivalent.
Top
Examples
 Dim dlg As Microsoft.Win32.OpenFileDialog = New Microsoft.Win32.OpenFileDialog()
dlg.Filter = "Images|*.jpg;*.png;*.tif;*.gif;*.bmp;*.wdp;*.xps"
If dlg.ShowDialog(Me).Value Then
    Dim image As Atalasoft.Imaging.AtalaImage = New Atalasoft.Imaging.AtalaImage(dlg.FileName)
    Dim source As BitmapSource = WpfConverter.AtalaImageToBitmapSource(image)
    image.Dispose()

    Me.Viewer.Source = source
End If
 Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.Filter = "Images|*.jpg;*.png;*.tif;*.gif;*.bmp;*.wdp;*.xps";
if (dlg.ShowDialog(this).Value)
{
    Atalasoft.Imaging.AtalaImage image = new Atalasoft.Imaging.AtalaImage(dlg.FileName);
    BitmapSource source = WpfConverter.AtalaImageToBitmapSource(image);
    image.Dispose();

    this.Viewer.Source = source;
}
See Also