Skip to main content
A newer version of this page is available. .

DXImageHelper.GetImageUri(String, ImageSize, ImageType) 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

public static Uri GetImageUri(
    string id,
    ImageSize imageSize,
    ImageType imageType = ImageType.Colored
)

Parameters

Name Type Description
id String

An image identifier.

imageSize DevExpress.Utils.Design.ImageSize

A predefined image size.

Optional Parameters

Name Type Default Description
imageType DevExpress.Utils.Design.ImageType 1

A predefined image type.

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 name 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 and specify the image’s size and type:

<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="pngImageSizedUri" Grid.Row="1"/>
    </Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
using DevExpress.Utils.Design;
// ...
private void Button_Click(object sender, RoutedEventArgs e) {
    pngImageSizedUri.Source = new BitmapImage(DXImageHelper.GetImageUri("Add", ImageSize.Size16x16, ImageType.GrayScaled));
}
See Also