---
title: "SvgReaderSettings.ResolveImage Property "
canonical: https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_SvgReaderSettings_ResolveImage.htm
product: "Graphics Mill"
---

# SvgReaderSettings.ResolveImage Property 
 
Gets or sets the callback that loads the images that the SVG file references.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public ResolveImageCallback ResolveImage { get; set; }
```
 
### Property Value
A [ResolveImageCallback](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ResolveImageCallback.htm.md) delegate, or `null`. The default value is `null`, which loads the images from the folder of the SVG file.
 
## Remarks
  
The reader calls this callback for every `<image>` element of the SVG file, except images embedded as `data:` URIs. Use it to load images that are stored somewhere else, for example, in another folder, in a database, or on a web server.
 
In the callback, set [Image](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_ResolveImageArgs_Image.htm.md) to a raster image or [GraphicsContainer](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_ResolveImageArgs_GraphicsContainer.htm.md) to vector content. If you set neither, the image is loaded from the folder of the SVG file.
 
If the callback throws an exception, the reader stops reading the file, and the [SvgReader](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_SvgReader.htm.md) constructor throws this exception.
 
## Examples
  
```csharp
const string assetsPrefix = "assets/";
const string assetsFolder = @"Images";

var settings = new SvgReaderSettings();

// The SVG file refers to images in the "assets" folder, which is stored somewhere else.
settings.ResolveImage = args =>
{
    if (args.Href.StartsWith(assetsPrefix, StringComparison.OrdinalIgnoreCase))
    {
        var fileName = System.IO.Path.Combine(assetsFolder, args.Href.Substring(assetsPrefix.Length));

        // The reader takes the image when the property is set, so you can dispose the bitmap right away.
        using (var bitmap = new Bitmap(fileName))
        {
            args.Image = bitmap;
        }
    }

    // If you set neither Image nor GraphicsContainer, the image is loaded from the folder of the SVG file.
};

using (var reader = new SvgReader(@"Images\SvgWithImage.svg", settings))
using (var writer = ImageWriter.Create(@"Images\Output\SvgWithImage.png"))
{
    Pipeline.Run(reader + writer);
}
```
 
The SVG file rendered with the image that the callback loads.
 ![The SVG file rendered with the image that the callback loads.](https://www.graphicsmill.com/docs/gm/SvgReaderResolveImage.png)
   
## See Also

### Reference

- [SvgReaderSettings Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_SvgReaderSettings.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
