ImageGear .NET v25.1 - Updated
textHorizontalAlignment Property

ImageGear.Web.UI Library > ImageGear.Web.UI Namespace > Mark class : textHorizontalAlignment Property
Specifies the horizontal alignment of text in a text mark.
Syntax
ASP.NET Ajax Javascript (Specification) 
function get_textHorizontalAlignment() : HorizontalAlignment
function set_textHorizontalAlignment(value : HorizontalAlignment)
ASP.NET Ajax Javascript (Usage) 
var resultVar = instanceOfMark.get_textHorizontalAlignment();
Example

This JavaScript code will create the mark shown in the image on this page.

// Create a new text mark.
var mark = new ImageGear.Web.UI.Mark(ImageGear.Web.UI.MarkType.Text);

// Set various properties.
mark.set_rectangle({ x: 100, y: 150, width: 275, height: 75 });
mark.set_text('This is a text mark.\nIt has two lines of text.');
mark.set_fontName('Arial');
mark.set_fontSize(14);
mark.set_fontStyle(ImageGear.Web.UI.FontStyle.Underline | ImageGear.Web.UI.FontStyle.Italic);
mark.set_textHorizontalAlignment(ImageGear.Web.UI.HorizontalAlignment.Center);
mark.set_textColor('#7070ff');

// Add the mark to the page.
// Adding it after setting the properties avoids a lot of needless markChanged events.
$find('PageView1').get_artPage().addMark(mark);
Remarks

This property specifies the horizontal alignment of text in a text mark. Note that text annotations can be rotated or mirrored using the textOrientation property and that orientation will affect the direction in which this property is applied. If you change the value of this property, this object will raise its propertyChanged event.

This figure shows a text mark whose text is centered.

Mark types: This property is valid for Text marks.
Valid values: Any member of the HorizontalAlignment enumeration.
Default value: ImageGear.Web.UI.HorizontalAlignment.Left

ImageGear for .NET name: AlignmentH
NotateXpress (version 10) name: TextJustification

See Also

Reference

Mark class
Mark Members