DXImageHelper.GetImageUri(String) Method
Returns a Uri that defines the specified image’s location.
Namespace: DevExpress.Xpf.Core
Assembly: DevExpress.Xpf.Core.v21.2.dll
NuGet Package: DevExpress.Wpf.Core
Declaration
Parameters
Name | Type | Description |
---|---|---|
path | String | A full path to an image in the library. |
Returns
Type | Description |
---|---|
Uri | A Uri object that contains a Uri to the image. |
Remarks
Use the DevExpress Image Picker tool to see images that are included in the DevExpress.Images.v21.2 assembly and copy an image’s path to a clipboard.
Display Raster Images
The following code sample uses the DXImageHelper.GetImageUri method to obtain a raster 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"/>
</Grid.RowDefinitions>
<Button Content="Display Image" Click="Button_Click" Width="150" Grid.Row="0"/>
<Image x:Name="pngImageUri" Height="32px" Grid.Row="1"/>
</Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
// ...
private void Button_Click(object sender, RoutedEventArgs e) {
pngImageUri.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"/>
</Grid.RowDefinitions>
<Button Content="Display 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"));
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetImageUri(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.