SPUtility.GetThemedImageUrl method

SharePoint 2013

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 static string GetThemedImageUrl(
	string originalUrl,
	string themeKey


Type: System.String

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

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.