SPUtility.GetThemedImageUrl method

Gets the path to the themed version of an image, if applicable. If the current web is not themed or there is no context web, the original URL is returned. Furthermore, if originalUrl or themeKey is null or empty, the originalUrl is always returned.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Shared Function GetThemedImageUrl ( _
    originalUrl As String, _
    themeKey As String _
) As String
Dim originalUrl As String
Dim themeKey As String
Dim returnValue As String

returnValue = SPUtility.GetThemedImageUrl(originalUrl, _
public static string GetThemedImageUrl(
    string originalUrl,
    string themeKey


  • originalUrl
    Type: System.String

    The original URL to the image. Must be a server-relative path.

  • themeKey
    Type: System.String

    The theme key passed into the ReplaceColor theming annotation.

Return value

Type: System.String
A server-relative URL to the themed image, or the original URL.

See also


SPUtility class

SPUtility members

Microsoft.SharePoint.Utilities namespace