DXImageHelper Class
Includes methods that you can use to obtain images from the DevExpress.Images.v21.2 assembly in code-behind.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v21.2.dll
NuGet Package: DevExpress.Wpf.Core
Declaration
Remarks
You can use the DevExpress Image Picker tool to see images included in the DevExpress.Images.v21.2 assembly and copy their paths to the clipboard.
Display Raster Images
The following code sample uses the DXImageHelper.GetImageSource and DXImageHelper.GetImageUri methods to obtain raster images from the DevExpress.Images.v21.2 assembly:
<dx:ThemedWindow ...
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30px"/>
<RowDefinition Height="32px"/>
<RowDefinition Height="32px"/>
</Grid.RowDefinitions>
<Button Content="Display Image" Click="Button_Click" Width="150" Grid.Row="0"/>
<Image x:Name="pngImage" Height="32px" Grid.Row="1"/>
<Image x:Name="pngImageUri" Height="32px" Grid.Row="2"/>
</Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
// ...
private void Button_Click(object sender, RoutedEventArgs e) {
pngimage.Source = DXImageHelper.GetImageSource(@"Images/Actions/Close_32x32.png");
pngimage_uri.Source = new BitmapImage(DXImageHelper.GetImageUri(@"Images/Actions/Close_32x32.png"));
}
Display Vector Images
The following code sample uses the DXImageHelper.GetImageUri method to obtain a vector image from the DevExpress.Images.v21.2 assembly:
<dx:ThemedWindow ...
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30px"/>
<RowDefinition Height="32px"/>
<RowDefinition Height="32px"/>
</Grid.RowDefinitions>
<Button Content="Display SVG Image" Click="Button_Click" Width="150" Grid.Row="0"/>
<Image x:Name="svgImage" Height="32px" Grid.Row="1"/>
</Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
// ...
private void Button_Click(object sender, RoutedEventArgs e) {
svgimage.Source = WpfSvgRenderer.CreateImageSource(DXImageHelper.GetImageUri(@"SvgImages/Reports/RepeatColumnHeadersOnEveryPage.svg"));
}
Inheritance
Object
DXImageHelper
See Also