Sitecore 5.0 API

MainUtil.GetImage Method (String, Int32, Int32, Int32, Int32, Boolean, Boolean, Boolean)

Gets an image HTML tag.

[Visual Basic]
Overloads Public Shared Function GetImage( _
   ByVal sImage As String, _
   ByVal nWidth As Integer, _
   ByVal nHeight As Integer, _
   ByVal nHSpace As Integer, _
   ByVal nVSpace As Integer, _
   ByVal bVerticalCenter As Boolean, _
   ByVal bDisabled As Boolean, _
   ByVal bDropShadow As Boolean _
) As String
[C#]
public static string GetImage(
   string sImage,
   int nWidth,
   int nHeight,
   int nHSpace,
   int nVSpace,
   bool bVerticalCenter,
   bool bDisabled,
   bool bDropShadow
);

Parameters

sImage
The source of the image.
nWidth
Width of the image.
nHeight
Height of the image.
nHSpace
Height of the image.
nVSpace
Vertical space.
bVerticalCenter
Indicates if the image is vertically centered.
bDisabled
Indicates if the image is grayed.
bDropShadow
Indicates if a drop show is drawn.

Return Value

The image HTML tag.

Example

  string img = MainUtil.GetImage("/sitecore/images/blank.gif", 20, 20, 4, 4, true, false, false); // <img src="/sitecore/images/blank.gif" border="0" width="20" height="20" vspace="4" hspace="4" style="vertical-align: middle;"/>

See Also

MainUtil Class | Sitecore Namespace | MainUtil.GetImage Overload List