Compartir a través de


TextBounds Structure

The bounds of a span of text in a given text line.

Namespace:  Microsoft.VisualStudio.Text.Formatting
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

Syntax

'Declaración
Public Structure TextBounds
public struct TextBounds
public value class TextBounds
[<Sealed>]
type TextBounds =  struct end
JScript supports the use of structures, but not the declaration of new ones.

The TextBounds type exposes the following members.

Constructors

  Name Description
Public method TextBounds Initializes a new instance of TextBounds.

Top

Properties

  Name Description
Public property Bottom Gets the position of the bottom edge of the rectangle in the text rendering coordinate system.
Public property Height Gets the distance between the top and bottom edges of the rectangle in the text rendering coordinate system.
Public property IsRightToLeft Determines whether the character is a right-to-left character.
Public property Leading Gets the position of the leading edge of the rectangle in the text rendering coordinate system.
Public property Left Gets the position of the left edge of the rectangle in the text rendering coordinate system.
Public property Right Gets the position of the right edge of the rectangle in the text rendering coordinate system.
Public property TextBottom Gets the bottom of the text on the line containing the characters.
Public property TextHeight Gets the height of the text on the line containing the characters.
Public property TextTop Gets the top of the text on the line containing the text.
Public property Top Gets the position of the top edge of the rectangle in the text rendering coordinate system.
Public property Trailing Gets the position of the trailing edge of the rectangle in the text rendering coordinate system.
Public property Width Gets the distance between the leading and trailing edges of the rectangle in the text rendering coordinate system.

Top

Methods

  Name Description
Public method Equals Determines whether two TextBounds objects are the same. (Overrides ValueType.Equals(Object).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Gets the hash code of the TextBounds object. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Converts the TextBounds object to a string. (Overrides ValueType.ToString().)

Top

Operators

  Name Description
Public operatorStatic member Equality Determines whether two TextBounds objects are the same.
Public operatorStatic member Inequality Determines whether two TextBounds objects are different.

Top

Remarks

Most properties and parameters that are doubles correspond to coordinates or distances in the text rendering coordinate system. In this coordinate system, x = 0.0 corresponds to the left edge of the drawing surface onto which text is rendered (x = view.ViewportLeft corresponds to the left edge of the viewport), and y = view.ViewportTop corresponds to the top edge of the viewport. The x-coordinate increases from left to right, and the y-coordinate increases from top to bottom. The horizontal and vertical axes of the view behave differently. When the text in the view is formatted, only the visible lines are formatted. As a result, a viewport cannot be scrolled horizontally and vertically in the same way. A viewport is scrolled horizontally by changing the left coordinate of the viewport so that it moves with respect to the drawing surface. A view can be scrolled vertically only by performing a new layout. Doing a layout in the view may cause the ViewportTop property of the view to change.

For example, scrolling down one line will not translate any of the visible lines. Instead it will simply change the view's ViewportTop property (causing the lines to move on the screen even though their y-coordinates have not changed). Distances in the text rendering coordinate system correspond to logical pixels. If the text rendering surface is displayed without any scaling transform, then 1 unit in the text rendering coordinate system corresponds to one pixel on the display.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Text.Formatting Namespace