ActionComponents  04.05.00
Customizable UI and time-saving tools for Android development with Xamarin and Visual Studio.
ActionComponents.ActionCanvasExtensions Class Reference

Helper extensions when working with Android drawing Canvas More...

Static Public Member Functions

static int TextHeight (string text, int width, int maxlines, Paint textPaint)
 Calculates the height of a block of text to be drawn in a canvas given the wrapping width and the maximum number of lines to draw More...
 
static void DrawTextBoxInCanvas (Canvas canvas, string text, int x, int y, int width, int maxlines, Paint textPaint)
 Draws a block of text at the given x,y coords in a canvas wrapping the text on the given width and stopping at the mx number of lines specified More...
 
static int MeasureTextBlock (string text, int width, int maxlines, Paint textPaint)
 Measures the height of the given text drawn with the given style properties, wrapping the text at the given width and stopping after a maximum number of lines. More...
 
static void DrawTextBlockInCanvas (Canvas canvas, string text, int x, int y, int width, int maxlines, Paint textPaint)
 Draws the given text at the given x,y coordinates in the given style in the given canvas. The text will be wrapping at the given width and will not exceed the given number of lines. The lines of text will be broken on word bounderies and newline or carriage returns can be included to force a line break. More...
 
static void DrawTextBlockInCanvas (Canvas canvas, string text, CGRect rect, Paint textPaint, TextBlockAlignment align)
 Draws the given text at the given x,y coordinates in the given style in the given canvas. The text will be wrapping at the given width and will not exceed the given number of lines. The lines of text will be broken on word bounderies and newline or carriage returns can be included to force a line break. More...
 
static void DrawTextBlockInCanvas (Canvas canvas, string text, int x, int y, int width, int maxlines, Paint textPaint, TextBlockAlignment align)
 Draws the given text at the given x,y coordinates in the given style in the given canvas. The text will be wrapping at the given width and will not exceed the given number of lines. The lines of text will be broken on word bounderies and newline or carriage returns can be included to force a line break. More...
 
static void DrawTextAligned (Canvas canvas, string text, int x, int y, int width, int height, Paint textPaint, TextBlockAlignment alignHorizontal, TextBlockAlignment alignVertical)
 Draws a single line of text aligned horizontaly and vertically inside the rectangle specified by the x,y and given width, height. More...
 
static void DrawTextAligned (Canvas canvas, string text, CGRect rect, Paint textPaint, TextBlockAlignment alignHorizontal, TextBlockAlignment alignVertical)
 Draws a single line of text aligned horizontaly and vertically inside the rectangle specified by the x,y and given width, height. More...
 
static void DrawTextAligned (Canvas canvas, string text, int x, int y, int width, int height, Paint textPaint, TextBlockAlignment alignHorizontal)
 Draws a single line of text aligned horizontally inside the rectangle specified by the x, y and the given width. More...
 
static void DrawTextAligned (Canvas canvas, string text, CGRect rect, Paint textPaint, TextBlockAlignment alignHorizontal)
 Draws a single line of text aligned horizontally inside the rectangle specified by the x, y and the given width. More...
 

Detailed Description

Helper extensions when working with Android drawing Canvas

Member Function Documentation

static void ActionComponents.ActionCanvasExtensions.DrawTextAligned ( Canvas  canvas,
string  text,
int  x,
int  y,
int  width,
int  height,
Paint  textPaint,
TextBlockAlignment  alignHorizontal,
TextBlockAlignment  alignVertical 
)
static

Draws a single line of text aligned horizontaly and vertically inside the rectangle specified by the x,y and given width, height.

Parameters
canvasCanvas.
textText.
xThe x coordinate.
yThe y coordinate.
widthWidth.
heightHeight.
textPaintText paint.
alignHorizontalAlign horizontal.
alignVerticalAlign vertical.

Here is the caller graph for this function:

static void ActionComponents.ActionCanvasExtensions.DrawTextAligned ( Canvas  canvas,
string  text,
CGRect  rect,
Paint  textPaint,
TextBlockAlignment  alignHorizontal,
TextBlockAlignment  alignVertical 
)
static

Draws a single line of text aligned horizontaly and vertically inside the rectangle specified by the x,y and given width, height.

Parameters
canvasCanvas.
textText.
rectRect.
textPaintText paint.
alignHorizontalAlign horizontal.
alignVerticalAlign vertical.

Here is the call graph for this function:

static void ActionComponents.ActionCanvasExtensions.DrawTextAligned ( Canvas  canvas,
string  text,
int  x,
int  y,
int  width,
int  height,
Paint  textPaint,
TextBlockAlignment  alignHorizontal 
)
static

Draws a single line of text aligned horizontally inside the rectangle specified by the x, y and the given width.

Parameters
canvasCanvas.
textText.
xThe x coordinate.
yThe y coordinate.
widthWidth.
heightHeight.
textPaintText paint.
alignHorizontalAlign horizontal.
static void ActionComponents.ActionCanvasExtensions.DrawTextAligned ( Canvas  canvas,
string  text,
CGRect  rect,
Paint  textPaint,
TextBlockAlignment  alignHorizontal 
)
static

Draws a single line of text aligned horizontally inside the rectangle specified by the x, y and the given width.

Parameters
canvasCanvas.
textText.
rectRect.
textPaintText paint.
alignHorizontalAlign horizontal.

Here is the call graph for this function:

static void ActionComponents.ActionCanvasExtensions.DrawTextBlockInCanvas ( Canvas  canvas,
string  text,
int  x,
int  y,
int  width,
int  maxlines,
Paint  textPaint 
)
static

Draws the given text at the given x,y coordinates in the given style in the given canvas. The text will be wrapping at the given width and will not exceed the given number of lines. The lines of text will be broken on word bounderies and newline or carriage returns can be included to force a line break.

Parameters
canvasCanvas.
textText.
xThe x coordinate.
yThe y coordinate.
widthWidth.
maxlinesMaxlines.
textPaintText paint.

This routine breaks on words

Here is the caller graph for this function:

static void ActionComponents.ActionCanvasExtensions.DrawTextBlockInCanvas ( Canvas  canvas,
string  text,
CGRect  rect,
Paint  textPaint,
TextBlockAlignment  align 
)
static

Draws the given text at the given x,y coordinates in the given style in the given canvas. The text will be wrapping at the given width and will not exceed the given number of lines. The lines of text will be broken on word bounderies and newline or carriage returns can be included to force a line break.

Parameters
canvasCanvas.
textText.
rectRect.
textPaintText paint.
alignAlign.

Here is the call graph for this function:

static void ActionComponents.ActionCanvasExtensions.DrawTextBlockInCanvas ( Canvas  canvas,
string  text,
int  x,
int  y,
int  width,
int  maxlines,
Paint  textPaint,
TextBlockAlignment  align 
)
static

Draws the given text at the given x,y coordinates in the given style in the given canvas. The text will be wrapping at the given width and will not exceed the given number of lines. The lines of text will be broken on word bounderies and newline or carriage returns can be included to force a line break.

Parameters
canvasCanvas.
textText.
xThe x coordinate.
yThe y coordinate.
widthWidth.
maxlinesMaxlines.
textPaintText paint.
alignThe text alignment

This routine breaks on words

static void ActionComponents.ActionCanvasExtensions.DrawTextBoxInCanvas ( Canvas  canvas,
string  text,
int  x,
int  y,
int  width,
int  maxlines,
Paint  textPaint 
)
static

Draws a block of text at the given x,y coords in a canvas wrapping the text on the given width and stopping at the mx number of lines specified

Parameters
canvasCanvas.
textText.
xThe x coordinate.
yThe y coordinate.
widthWidth.
maxlinesMaxlines.
textPaintText paint.

This routine breaks on character not words

static int ActionComponents.ActionCanvasExtensions.MeasureTextBlock ( string  text,
int  width,
int  maxlines,
Paint  textPaint 
)
static

Measures the height of the given text drawn with the given style properties, wrapping the text at the given width and stopping after a maximum number of lines.

Returns
The text block.
Parameters
textText.
widthWidth.
maxlinesMaxlines.
textPaintText paint.

This routine breaks on words

Here is the caller graph for this function:

static int ActionComponents.ActionCanvasExtensions.TextHeight ( string  text,
int  width,
int  maxlines,
Paint  textPaint 
)
static

Calculates the height of a block of text to be drawn in a canvas given the wrapping width and the maximum number of lines to draw

Returns
The height.
Parameters
textText.
widthWidth.
maxlinesMaxlines.
textPaintText paint.

This routines breaks on character not words

Here is the caller graph for this function: