Class SpreadsheetTextBoxPaint
Inheritance
Namespace: Syncfusion.UI.Xaml.Spreadsheet.Helpers
Assembly: Syncfusion.SfSpreadsheet.WPF.dll
Syntax
public static class SpreadsheetTextBoxPaint : Object
Methods
DrawFormattedText(SpreadsheetGrid, RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)
Draw the text using FormattedText
Declaration
public static void DrawFormattedText(SpreadsheetGrid grid, RowColumnIndex rowcolIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetGrid | grid | SpreadsheetGrid |
RowColumnIndex | rowcolIndex | RowColumnIndex |
System.Windows.Media.DrawingContext | dc | DrawingContext where the text is to be drawn |
System.Windows.Rect | cellRect | Rect of the cell |
SpreadsheetColumn | column | SpreadsheetColumn |
System.Object | textElement | TextElement(FormattedText), if already got while measuring the text |
DrawGlyphs(SpreadsheetGrid, RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)
Draw the text using GlyphRun, which is faster than DrawFormattedText.
Declaration
public static void DrawGlyphs(SpreadsheetGrid grid, RowColumnIndex rowcolIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetGrid | grid | SpreadsheetGrid |
RowColumnIndex | rowcolIndex | RowColumnIndex |
System.Windows.Media.DrawingContext | dc | DrawingContext where the text is to be drawn |
System.Windows.Rect | cellRect | Rect of the cell |
SpreadsheetColumn | column | SpreadsheetColumn |
System.Object | textElement | TextElement(GlyphRun), if already got while measuring the text |
DrawText(SpreadsheetGrid, RowColumnIndex, DrawingContext, Rect, SpreadsheetColumn, Object)
Draw the text using GlyphRun or FormattedText based on the style and text.
Declaration
public static void DrawText(this SpreadsheetGrid grid, RowColumnIndex rowcolIndex, DrawingContext dc, Rect cellRect, SpreadsheetColumn column, object textElement)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetGrid | grid | SpreadsheetGrid |
RowColumnIndex | rowcolIndex | RowColumnIndex |
System.Windows.Media.DrawingContext | dc | DrawingContext where the text is to be drawn |
System.Windows.Rect | cellRect | Rect of the cell |
SpreadsheetColumn | column | SpreadsheetColumn |
System.Object | textElement | TextElement(GlyphRun or FormattedText), if already got while measuring the text |
MeasureText(SpreadsheetGrid, String, SpreadsheetColumn, Double, Boolean, Int32, out Object)
Measures the size of the text using either FormattedText or GlyphRun.
Declaration
public static Size MeasureText(this SpreadsheetGrid grid, string text, SpreadsheetColumn column, double cellWidth, bool wraptext, int lineCount, out object textElement)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetGrid | grid | SpreadsheetGrid |
System.String | text | Text which size is to be measured |
SpreadsheetColumn | column | SpreadsheetColumn |
System.Double | cellWidth | Width of the cell |
System.Boolean | wraptext | True, if text is wrapped in a cell |
System.Int32 | lineCount | If text is wrapped, maximum possible line count |
System.Object | textElement | Returns the TextElement(GlyphRun or FormattedText) which used to measure |
Returns
Type | Description |
---|---|
System.Windows.Size | Size of the text |
MeasureTextUsingFormattedText(SpreadsheetGrid, String, IStyle, Double, Boolean, Int32, out Object)
Measures the size of the text using FormattedText.
Declaration
public static Size MeasureTextUsingFormattedText(SpreadsheetGrid grid, string text, IStyle excelStyle, double cellWidth, bool wraptext, int lineCount, out object textElement)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetGrid | grid | SpreadsheetGrid |
System.String | text | Text which size is to be measured |
IStyle | excelStyle | IStyle of the cell |
System.Double | cellWidth | Width of the cell |
System.Boolean | wraptext | True, if text is wrapped in a cell |
System.Int32 | lineCount | If text is wrapped, maximum possible line count |
System.Object | textElement | Returns the TextElement(FormattedText) which used to measure |
Returns
Type | Description |
---|---|
System.Windows.Size | Size of the text |
MeasureTextUsingGlyphs(SpreadsheetGrid, String, IStyle, out Boolean, out Object)
Measures the size of the text using GlyphRun which is faster than FormattedText.
Declaration
public static Size MeasureTextUsingGlyphs(SpreadsheetGrid grid, string text, IStyle excelStyle, out bool isCalculated, out object textElement)
Parameters
Type | Name | Description |
---|---|---|
SpreadsheetGrid | grid | SpreadsheetGrid |
System.String | text | Text which size is to be measured |
IStyle | excelStyle | IStyle of the cell |
System.Boolean | isCalculated | True, if size is calculated |
System.Object | textElement | Returns the TextElement(FormattedText) which used to measure |
Returns
Type | Description |
---|---|
System.Windows.Size | Size of the text |