This topic has not yet been rated - Rate this topic

ImageFieldValue.Height Property

Gets or sets the explicit height, in pixels, used to allow a Web browser to scale the image.

Namespace:  Microsoft.SharePoint.Publishing.Fields
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)
public int Height { get; set; }

Property Value

Type: System.Int32
Default is 0.

If this value is greater than 0, then a height attribute is added to the <IMG> tag. If the value is set to 0 or less, no height attribute is used and the image retains its default height.

// You can change any of the following data that are set into the ImageFieldValue
private const string NewImageUrl = "/SiteCollectionImages/SampleImage.jpg";
private const string NewHyperlink = "/Pages/SamplePage.aspx";
private const bool NewOpenHyperlinkInNewWindow = true;
private const string NewAlignment = "right";
private const string NewAlternateText = "Sample alternate text for the image";
private const int NewBorderWidth = 4;
private const int NewHeight = 100;
private const int NewWidth = 150;
private const int NewHorizontalSpacing = 10;
private const int NewVerticalSpacing = 15
NoteNote

This example is part of the larger ImageFieldValue sample in the ImageFieldValue topic.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ