SpreadsheetPaint Class
Inheritance
Implements
Namespace: Syncfusion.Windows.Forms.Spreadsheet.Helpers
Assembly: Syncfusion.Spreadsheet.Windows.dll
Syntax
public class SpreadsheetPaint : Object, IDisposable
Constructors
SpreadsheetPaint(Graphics)
Initialize.
Declaration
public SpreadsheetPaint(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g |
Methods
Dispose()
Release current HDC to be able to use Syncfusion.Windows.Forms.Spreadsheet.Helpers.SpreadsheetPaint.Graphics methods.
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
DrawBitMap(Bitmap, Rectangle)
Draws the BitMap into the rectangle area.
Declaration
public void DrawBitMap(Bitmap bitmap, Rectangle cellRect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Bitmap | bitmap | Bitmap |
| System.Drawing.Rectangle | cellRect | Rectangle area |
DrawLine(Pen, Int32, Int32, Int32, Int32)
Draw the line.
Declaration
public void DrawLine(Pen pen, int x1, int y1, int x2, int y2)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Pen | pen | Pen |
| System.Int32 | x1 | Start X position |
| System.Int32 | y1 | Start Y position |
| System.Int32 | x2 | End X position |
| System.Int32 | y2 | End Y position |
DrawRectangle(Pen, Rectangle)
Draw the rectangle
Declaration
public void DrawRectangle(Pen pen, Rectangle rect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Pen | pen | Pen |
| System.Drawing.Rectangle | rect | Rectangle area |
DrawRichText(Rectangle, Rectangle, SpreadsheetColumn)
Draw the RichText
Declaration
public void DrawRichText(Rectangle rect, Rectangle clipRect, SpreadsheetColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Rectangle | rect | Rectangle area |
| System.Drawing.Rectangle | clipRect | Clipped rectangle area |
| SpreadsheetColumn | column | see cref="SpreadsheetColumn"/> |
DrawText(Rectangle, Rectangle, SpreadsheetColumn)
Draw the text
Declaration
public void DrawText(Rectangle rect, Rectangle clipRect, SpreadsheetColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Rectangle | rect | Rectangle area |
| System.Drawing.Rectangle | clipRect | Clipped rectangle area |
| SpreadsheetColumn | column |
FillGradientRectangle(Color, Color, Rectangle)
Fill the rectangle.
Declaration
public void FillGradientRectangle(Color color1, Color color2, Rectangle rect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Color | color1 | start color |
| System.Drawing.Color | color2 | end color |
| System.Drawing.Rectangle | rect | Rectangle area |
FillRectangle(Color, Rectangle)
Fill the rectangle.
Declaration
public void FillRectangle(Color color, Rectangle rect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Color | color | fill color |
| System.Drawing.Rectangle | rect | Rectangle area |
MeasureText(String, Font)
Measure the width and height of string str when drawn on device context HDC
using the given font font.
Declaration
public Size MeasureText(string str, Font font)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | the string to measure |
| System.Drawing.Font | font | the font to measure string with |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | the size of the string |
MeasureText(String, Font, Int32, Boolean)
Measure the text size by MeasureString of Graphics object.
Declaration
public Size MeasureText(string text, Font font, int width, bool wrapText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The string to measure |
| System.Drawing.Font | font | The font to measure string with |
| System.Int32 | width | The max width to measure string |
| System.Boolean | wrapText | If true, the text wrapping has applied else not. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | The size of the string |
MeasureText(String, Font, Single, out Int32, out Int32)
Measure the width and height of string str when drawn on device context HDC
using the given font font.
Restrict the width of the string and get the number of characters able to fit in the restriction and
the width those characters take.
Declaration
public Size MeasureText(string str, Font font, float maxWidth, out int charFit, out int charFitWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | the string to measure |
| System.Drawing.Font | font | the font to measure string with |
| System.Single | maxWidth | the max width to render the string in |
| System.Int32 | charFit | the number of characters that will fit under maxWidth restriction |
| System.Int32 | charFitWidth |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | the size of the string |