---
title: "Load a DICOM image from a remote URL in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-dicom/"
md_url: "https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-dicom.md"
last_updated: "2026-05-30T02:20:01.265Z"
description: "Discover how to load remote images in .NET, including formats like SVG, DICOM, and TIFF. Follow our step-by-step guide for seamless integration."
---

# Load a DICOM image from a remote URL in C#

### Image

[Image](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-image.md)

### Bitmap

[Bitmap](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-bitmap.md)

### SVG

[SVG](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-svg.md)

### DICOM

[DICOM](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-dicom.md)

### TIFF

[TIFF](https://www.nutrient.io/guides/dotnet/load-a-file/imaging/from-remote-url-tiff.md)

To load a DICOM image from a remote URL, use the [`CreateGdPictureImageFromHTTP` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~CreateGdPictureImageFromHTTP.html) from the [`GdPictureImaging` class](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging.html).

This method returns a non-zero image identifier (`imageID`) on success. If it fails, it returns `0` — use `GetStat()` and `GetLastTransferError()` to diagnose failures.

It supports two common scenarios:

- [Public server](#loading-a-dicom-image-from-a-public-server)

- [Protected server](#loading-a-dicom-image-from-a-protected-server)

If the loaded DICOM has multiple pages/frames, you can use:

- [`DicomGetPageCount` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~DicomGetPageCount.html)

- [`DicomSelectPage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~DicomSelectPage.html)

> When transferring data to or from remote servers, you can optionally use the [`SetHttpTransferBufferSize` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~SetHttpTransferBufferSize.html) to control transfer buffer size.

## Loading a DICOM image from a public server

Use this overload: `CreateGdPictureImageFromHTTP(string Host, string Path, int HTTPPort)`.

Remember to release the image resource once you stop using it. Use the [`ReleaseGdPictureImage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~ReleaseGdPictureImage.html).

To load a DICOM image from a public server, use the following code:

### C#

```csharp

using GdPicture14;
using System;

using GdPictureImaging gdpictureImaging = new GdPictureImaging();

int imageID = gdpictureImaging.CreateGdPictureImageFromHTTP(
    "https://pspdfkit.com",
    "/downloads/load-a-file/source.dcm",
    443);

if (imageID == 0)
{
    Console.WriteLine($"HTTP load failed: {gdpictureImaging.GetStat()}");
    Console.WriteLine($"Transfer error: {gdpictureImaging.GetLastTransferError()}");
    return;
}

int pageCount = gdpictureImaging.DicomGetPageCount(imageID);
if (pageCount > 1)
{
    GdPictureStatus selectStatus = gdpictureImaging.DicomSelectPage(imageID, 1);
    if (selectStatus!= GdPictureStatus.OK)
    {
        Console.WriteLine($"DicomSelectPage failed: {selectStatus}");
        gdpictureImaging.ReleaseGdPictureImage(imageID);
        return;
    }
}

GdPictureStatus saveStatus = gdpictureImaging.SaveAsPNG(imageID, @"C:\temp\output.png");
if (saveStatus!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAsPNG failed: {saveStatus}");
}

gdpictureImaging.ReleaseGdPictureImage(imageID);

```

### VB.NET

```vb

Imports GdPicture14

Using gdpictureImaging As New GdPictureImaging()
    Dim imageID As Integer = gdpictureImaging.CreateGdPictureImageFromHTTP(
        "https://pspdfkit.com",
        "/downloads/load-a-file/source.dcm",
        443)

    If imageID = 0 Then
        Console.WriteLine($"HTTP load failed: {gdpictureImaging.GetStat()}")
        Console.WriteLine($"Transfer error: {gdpictureImaging.GetLastTransferError()}")
        Return
    End If

    Dim pageCount As Integer = gdpictureImaging.DicomGetPageCount(imageID)
    If pageCount > 1 Then
        Dim selectStatus As GdPictureStatus = gdpictureImaging.DicomSelectPage(imageID, 1)
        If selectStatus <> GdPictureStatus.OK Then
            Console.WriteLine($"DicomSelectPage failed: {selectStatus}")
            gdpictureImaging.ReleaseGdPictureImage(imageID)
            Return
        End If
    End If

    Dim saveStatus As GdPictureStatus = gdpictureImaging.SaveAsPNG(imageID, "C:\temp\output.png")
    If saveStatus <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAsPNG failed: {saveStatus}")
    End If

    gdpictureImaging.ReleaseGdPictureImage(imageID)
End Using

```

## Loading a DICOM image from a protected server

Use this overload: `CreateGdPictureImageFromHTTP(string Uri, string Login, string Password)`.

Remember to release the image resource once you stop using it. Use the [`ReleaseGdPictureImage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPictureImaging~ReleaseGdPictureImage.html).

To load a DICOM image from a protected server, use the following code:

### C#

```csharp

using GdPicture14;
using System;

using GdPictureImaging gdpictureImaging = new GdPictureImaging();

int imageID = gdpictureImaging.CreateGdPictureImageFromHTTP(
    "https://pspdfkit.com/downloads/load-a-file/source.dcm",
    "admin",
    "password");

if (imageID == 0)
{
    Console.WriteLine($"HTTP load failed: {gdpictureImaging.GetStat()}");
    Console.WriteLine($"Transfer error: {gdpictureImaging.GetLastTransferError()}");
    return;
}

int pageCount = gdpictureImaging.DicomGetPageCount(imageID);
if (pageCount > 1)
{
    GdPictureStatus selectStatus = gdpictureImaging.DicomSelectPage(imageID, 1);
    if (selectStatus!= GdPictureStatus.OK)
    {
        Console.WriteLine($"DicomSelectPage failed: {selectStatus}");
        gdpictureImaging.ReleaseGdPictureImage(imageID);
        return;
    }
}

GdPictureStatus saveStatus = gdpictureImaging.SaveAsPNG(imageID, @"C:\temp\output.png");
if (saveStatus!= GdPictureStatus.OK)
{
    Console.WriteLine($"SaveAsPNG failed: {saveStatus}");
}

gdpictureImaging.ReleaseGdPictureImage(imageID);

```

### VB.NET

```vb

Imports GdPicture14

Using gdpictureImaging As New GdPictureImaging()
    Dim imageID As Integer = gdpictureImaging.CreateGdPictureImageFromHTTP(
        "https://pspdfkit.com/downloads/load-a-file/source.dcm",
        "admin",
        "password")

    If imageID = 0 Then
        Console.WriteLine($"HTTP load failed: {gdpictureImaging.GetStat()}")
        Console.WriteLine($"Transfer error: {gdpictureImaging.GetLastTransferError()}")
        Return
    End If

    Dim pageCount As Integer = gdpictureImaging.DicomGetPageCount(imageID)
    If pageCount > 1 Then
        Dim selectStatus As GdPictureStatus = gdpictureImaging.DicomSelectPage(imageID, 1)
        If selectStatus <> GdPictureStatus.OK Then
            Console.WriteLine($"DicomSelectPage failed: {selectStatus}")
            gdpictureImaging.ReleaseGdPictureImage(imageID)
            Return
        End If
    End If

    Dim saveStatus As GdPictureStatus = gdpictureImaging.SaveAsPNG(imageID, "C:\temp\output.png")
    If saveStatus <> GdPictureStatus.OK Then
        Console.WriteLine($"SaveAsPNG failed: {saveStatus}")
    End If

    gdpictureImaging.ReleaseGdPictureImage(imageID)
End Using

```
---

## Related pages

- [Load a vector image (SVG) from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-svg.md)
- [Load a TIFF from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-tiff.md)
- [Load an image from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-image.md)
- [Load a DICOM image from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-dicom.md)
- [Load a DICOM image from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-dicom.md)
- [Load images from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-image.md)
- [Load a bitmap (BMP) from a byte array in C#](/guides/dotnet/load-a-file/imaging/from-byte-array-bitmap.md)
- [Load a bitmap (BMP) from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-bitmap.md)
- [Load a TIFF from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-tiff.md)
- [Load a vector image (SVG) from local storage in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-svg.md)
- [Load images using the API in C#](/guides/dotnet/load-a-file/imaging/from-local-storage-more.md)
- [Load a bitmap (BMP) from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-bitmap.md)
- [Load an image from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-image.md)
- [Load a vector image (SVG) from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-svg.md)
- [Load a DICOM image from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-dicom.md)
- [Load a TIFF from a remote URL in C#](/guides/dotnet/load-a-file/imaging/from-remote-url-tiff.md)
- [Load a vector image (SVG) from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-svg.md)
- [Load a bitmap (BMP) from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-bitmap.md)
- [Load an image from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-image.md)
- [Load a TIFF from a stream in C#](/guides/dotnet/load-a-file/imaging/from-stream-tiff.md)

