Graphics Class
Namespace: Stimulsoft.System.Drawing
Constructors
| Constructor | Description |
|---|---|
| constructor(CanvasRenderingContext2D context) |
constructor(context: CanvasRenderingContext2D)
Parameters
- context (CanvasRenderingContext2D)
Methods
| Method | Returns | Description |
|---|---|---|
addCustomFont static |
void | |
addCustomFontBytes static |
string | |
addCustomFontFile static |
void | |
addCustomFontFileAsync static |
void | |
allowStyle static |
boolean | |
| callback | void | |
clearAutoLoadFonts static |
void | |
clearCache static |
void | |
| drawImage | void | |
| drawLine | void | |
| drawRectangle | void | |
| drawString | void | |
| fillRectangle | void | |
getCustomFont static |
any | |
getCustomFontName static |
string | |
getCustomFontsCss static |
string | |
getFontMimeType static |
string | |
getLineHeightFactor static |
number | |
measureChars static |
Size | |
measureString static |
Size | |
| translateTransform | void |
Method Details
addCustomFont static
addCustomFont(font: FontKitType, fontName: string, binFont: any, filePath: string, fontStyle: FontStyle, store: any): void
Parameters
- font (FontKitType)
- fontName (string)
- binFont (any)
- filePath (string)
- fontStyle (FontStyle)
- store (any)
addCustomFontBytes static
addCustomFontBytes(data: ArrayBuffer | Uint8Array, fontName: string, fontStyle: FontStyle, store: any): string
Parameters
- data (ArrayBuffer | Uint8Array)
- fontName (string)
- fontStyle (FontStyle)
- store (any)
Returns string
addCustomFontFile static
addCustomFontFile(filePath: string, fontName: string, fontStyle: FontStyle, store: any): void
Parameters
- filePath (string)
- fontName (string)
- fontStyle (FontStyle)
- store (any)
addCustomFontFileAsync static
addCustomFontFileAsync(callback: ()): void
Parameters
- callback (())
allowStyle static
allowStyle(fontName: string, fontStyle: FontStyle): boolean
Parameters
- fontName (string)
- fontStyle (FontStyle)
Returns boolean
callback
callback(): void
clearAutoLoadFonts static
clearAutoLoadFonts(): void
clearCache static
clearCache(): void
drawImage
drawImage(image: Image, point: Point): void
Parameters
drawLine
drawLine(pen: Pen, x1: number, y1: number, x2: number, y2: number): void
Parameters
- pen (Pen)
- x1 (number)
- y1 (number)
- x2 (number)
- y2 (number)
drawRectangle
drawRectangle(pen: Pen, rect: Rectangle): void
Parameters
drawString
drawString(text: string, font: Font, brush: Brush, x: number, y: number): void
Parameters
fillRectangle
fillRectangle(brush: Brush, x: number, y: number, width: number, height: number): void
Parameters
- brush (Brush)
- x (number)
- y (number)
- width (number)
- height (number)
getCustomFont static
getCustomFont(fontName: string, fontStyle: FontStyle): any
Parameters
- fontName (string)
- fontStyle (FontStyle)
Returns any
getCustomFontName static
getCustomFontName(fontName: string, fontStyle: FontStyle): string
Parameters
- fontName (string)
- fontStyle (FontStyle)
Returns string
getCustomFontsCss static
getCustomFontsCss(embeddedData: any): string
Parameters
- embeddedData (any)
Returns string
getFontMimeType static
getFontMimeType(data: any): string
Parameters
- data (any)
Returns string
getLineHeightFactor static
getLineHeightFactor(font: string | Font): number
Parameters
- font (string | Font)
Returns number
measureChars static
measureChars(chars: number[], count: number, font: Font): Size
Parameters
- chars (number[])
- count (number)
- font (Font)
Returns Size
measureString static
measureString(text: string, font: Font, width: number, useCache: any, multiple: any, angle: any, replaceTags: any): Size
Parameters
- text (string)
- font (Font)
- width (number)
- useCache (any)
- multiple (any)
- angle (any)
- replaceTags (any)
Returns Size
translateTransform
translateTransform(dx: number, dy: number): void
Parameters
- dx (number)
- dy (number)
Fields
| Field | Type | Description |
|---|---|---|
| binFont | any | |
| css | any | |
| customFont | any | |
| customFont | any | |
| customFont | any | |
| customFontHash | any | |
| customFontHash | any | |
| customFontObject | any | |
| embeddedData | any | |
| factor | any | |
| factor | any | |
| factor | any | |
| font | any | |
| font | any | |
| font | any | |
| font | any | |
| fontStyle | any | |
| glyphs | any | |
| key | any | |
| maxWidth2 | any | |
| maxWidth2 | any | |
| size | any | |
| size | any | |
| size | any | |
| size | any | |
| size | any | |
| size | any | |
| size1 | any | |
| sizeA | any | |
| sizes | any | |
| sizes | any | |
| st1 | any | |
| text | any | |
| width2 | any |