public interface IRenderContext2D
extends com.scichart.core.framework.IDisposable
IRenderSurface
Modifier and Type | Method and Description |
---|---|
IPathDrawingContext |
beginLine(IPen2D pen,
float x,
float y)
Begins a line segment, returning the
IPathDrawingContext |
ITextDrawingContext |
beginTextDrawing(IFont font,
int textColor)
Begins a text batch using same
IFont instance and same text color |
IPathDrawingContext |
beginTrianglesStrip(IBrush2D brush,
float x,
float y)
Begins a filled triangle strips segment, returning the
IPathDrawingContext |
void |
clear()
Clears the
IRenderSurface |
void |
drawCanvasTexture(ICanvasTexture2D texture,
com.scichart.core.common.Action1<android.graphics.Canvas> drawingCommand)
Executed drawing command which used
Canvas API. |
void |
drawEllipse(float xCenter,
float yCenter,
float width,
float height,
IBrush2D fillBrush)
Draws a single ellipse on the
IRenderSurface using the specified IBrush2D |
void |
drawEllipse(float xCenter,
float yCenter,
float width,
float height,
IPen2D strokePen)
Draws a single ellipse on the
IRenderSurface using the specified IPen2D |
void |
drawEllipse(float xCenter,
float yCenter,
float width,
float height,
IPen2D strokePen,
IBrush2D fillBrush)
|
void |
drawEllipses(float[] points,
int startIndex,
int count,
float width,
float height,
IBrush2D fillBrush)
Draws a series of ellipses.
|
void |
drawEllipses(float[] points,
int startIndex,
int count,
float width,
float height,
IPen2D strokePen)
Draws a series of ellipses.
|
void |
drawEllipses(float[] points,
int startIndex,
int count,
float width,
float height,
IPen2D strokePen,
IBrush2D fillBrush)
Draws a series of ellipses.
|
void |
drawLine(float x1,
float y1,
float x2,
float y2,
IPen2D pen)
Draws a single line on the
IRenderSurface using the specified IPen2D |
void |
drawLines(float[] points,
int startIndex,
int count,
IPen2D pen)
Draws a series of lines.
|
void |
drawLinesStrip(float[] points,
int startIndex,
int count,
IPen2D pen)
Draws a lines strip.
|
void |
drawRect(float x1,
float y1,
float x2,
float y2,
IPen2D pen)
Draws a single rectangle on the
IRenderSurface using the specified IPen2D |
void |
drawRects(float[] points,
int startIndex,
int count,
IPen2D pen)
Draws a series of rectangles.
|
void |
drawSprite(ITexture2D sprite,
float x,
float y)
Draws a sprite at specified x, y coordinate
|
void |
drawSprite(ITexture2D sprite,
float x,
float y,
float opacity)
Draws a sprite at specified x, y coordinate
|
void |
drawSprites(ITexture2D sprite,
float[] points,
int startIndex,
int count)
Draws a series of sprites.
|
void |
drawSprites(ITexture2D sprite,
float[] points,
int startIndex,
int count,
float opacity)
Draws a series of sprites.
|
void |
drawText(IFont font,
float x,
float y,
int textColor,
java.lang.String text)
Draws text at x,y coordinate using a specified font and text color
|
void |
drawTexture(ITexture2D texture,
float[] points,
int startIndex,
int count)
Draws a series of textures.
|
void |
drawTexture(ITexture2D texture,
float[] points,
int startIndex,
int count,
float opacity)
Draws a series of textures.
|
void |
drawTexture(ITexture2D texture,
float x1,
float y1,
float x2,
float y2)
Fills a single rectangle on the
IRenderSurface using the specified ITexture2D |
void |
drawTexture(ITexture2D texture,
float x1,
float y1,
float x2,
float y2,
float opacity)
Fills a single rectangle on the
IRenderSurface using the specified ITexture2D |
void |
drawTrianglesStrip(float[] points,
int startIndex,
int count,
IBrush2D brush)
Draws a triangle strip.
|
void |
fillRect(float x1,
float y1,
float x2,
float y2,
IBrush2D brush)
Fills a single rectangle on the
IRenderSurface using the specified IBrush2D |
void |
fillRects(float[] points,
int startIndex,
int count,
IBrush2D brush)
Fills a series of rectangles.
|
int |
getViewportHeight()
Gets the current viewport height
|
int |
getViewportWidth()
Gets the current viewport width
|
void |
restore()
This call balances a previous call to save(), and is used to remove all
modifications made by
translate(float, float) ,
rotate(float) , scale(float, float) and
setClipRect(float, float, float, float) calls since the last save call. |
void |
rotate(float degrees)
Rotates this
IRenderContext2D on specified angle |
void |
save()
Saves the current transformation and clip rect onto a private stack.
|
void |
scale(float x,
float y)
Scales this
IRenderContext2D by the provided x, y values |
void |
setClipRect(float left,
float top,
float right,
float bottom)
Sets clip rect for this
IRenderContext2D at specified coordinates in pixels |
void |
setTexturePixels(IPixelTexture2D texture,
int[] pixels,
int startIndex)
Sets the texture pixels based on values provided by pixels array
|
void |
setTexturePixels(IPixelTexture2D texture,
int x,
int y,
int width,
int height,
int[] pixels,
int startIndex)
Sets the region of texture pixels based on values provided by pixels array
|
void |
translate(float dx,
float dy)
Translates this
IRenderContext2D by specified x, y offset |
int getViewportWidth()
int getViewportHeight()
void drawLine(float x1, float y1, float x2, float y2, IPen2D pen)
IRenderSurface
using the specified IPen2D
x1
- The x1 coordinate in pixelsy1
- The y1 coordinate in pixelsx2
- The x2 coordinate in pixelsy2
- The y2 coordinate in pixelspen
- The pen to draw line withvoid drawRect(float x1, float y1, float x2, float y2, IPen2D pen)
IRenderSurface
using the specified IPen2D
x1
- The x1 coordinate in pixelsy1
- The y1 coordinate in pixelsx2
- The x2 coordinate in pixelsy2
- The y2 coordinate in pixelspen
- The pen to draw rect withvoid fillRect(float x1, float y1, float x2, float y2, IBrush2D brush)
IRenderSurface
using the specified IBrush2D
x1
- The x1 coordinate in pixelsy1
- The y1 coordinate in pixelsx2
- The x2 coordinate in pixelsy2
- The y2 coordinate in pixelsbrush
- The brush to fill rectangle withvoid drawEllipse(float xCenter, float yCenter, float width, float height, IPen2D strokePen, IBrush2D fillBrush)
xCenter
- The x center coordinate in pixelsyCenter
- The y center coordinate in pixelswidth
- The width of ellipse in pixelsheight
- The height of ellipse in pixelsstrokePen
- The pen to draw ellipse stroke withfillBrush
- The brush to fill ellipse withvoid drawEllipse(float xCenter, float yCenter, float width, float height, IPen2D strokePen)
IRenderSurface
using the specified IPen2D
xCenter
- The x center coordinate in pixelsyCenter
- The y center coordinate in pixelswidth
- The width of ellipse in pixelsheight
- The height of ellipse in pixelsstrokePen
- The pen to draw ellipse stroke withvoid drawEllipse(float xCenter, float yCenter, float width, float height, IBrush2D fillBrush)
IRenderSurface
using the specified IBrush2D
xCenter
- The x center coordinate in pixelsyCenter
- The y center coordinate in pixelswidth
- The width of ellipse in pixelsheight
- The height of ellipse in pixelsfillBrush
- The brush to fill ellipse withvoid drawSprite(ITexture2D sprite, float x, float y)
sprite
- The sprite to drawx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsvoid drawSprite(ITexture2D sprite, float x, float y, float opacity)
sprite
- The sprite to drawx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsopacity
- The opacity to draw sprite withIPathDrawingContext beginLine(IPen2D pen, float x, float y)
IPathDrawingContext
pen
- The pen for line segmentx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsIPathDrawingContext
to continue the lineIPathDrawingContext beginTrianglesStrip(IBrush2D brush, float x, float y)
IPathDrawingContext
brush
- The brush for triangle strips segmentx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsIPathDrawingContext
to continue the linevoid drawLines(float[] points, int startIndex, int count, IPen2D pen)
points
- Array of points to draw [x0 y0 x1 y1 x2 y2 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraypen
- The pen to draw lines withvoid drawLinesStrip(float[] points, int startIndex, int count, IPen2D pen)
points
- Array of points to draw [x0 y0 x1 y1 x2 y2 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraypen
- The pen to draw lines withvoid drawTrianglesStrip(float[] points, int startIndex, int count, IBrush2D brush)
points
- Array of points to draw [x0 y0 x1 y1 x2 y2 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraybrush
- The brush to fill triangles withvoid drawSprites(ITexture2D sprite, float[] points, int startIndex, int count)
sprite
- The spite to drawpoints
- Array of points to draw [x0 y0 x1 y1 x2 y2 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arrayvoid drawSprites(ITexture2D sprite, float[] points, int startIndex, int count, float opacity)
sprite
- The spite to drawpoints
- Array of points to draw [x0 y0 x1 y1 x2 y2 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arrayopacity
- The opacity to draw sprite withvoid drawTexture(ITexture2D texture, float x1, float y1, float x2, float y2)
IRenderSurface
using the specified ITexture2D
texture
- The texture to drawx1
- The x1 coordinate in pixelsy1
- The y1 coordinate in pixelsx2
- The x2 coordinate in pixelsy2
- The y2 coordinate in pixelsvoid drawTexture(ITexture2D texture, float x1, float y1, float x2, float y2, float opacity)
IRenderSurface
using the specified ITexture2D
texture
- The texture to drawx1
- The x1 coordinate in pixelsy1
- The y1 coordinate in pixelsx2
- The x2 coordinate in pixelsy2
- The y2 coordinate in pixelsopacity
- The opacity to draw texture withvoid drawTexture(ITexture2D texture, float[] points, int startIndex, int count)
texture
- The texture to drawpoints
- Array of points to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arrayvoid drawTexture(ITexture2D texture, float[] points, int startIndex, int count, float opacity)
texture
- The texture to drawpoints
- Array of points to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arrayopacity
- The opacity to draw texture withvoid setTexturePixels(IPixelTexture2D texture, int[] pixels, int startIndex)
texture
- The texture to set pixels forpixels
- The array with values of texture pixelsstartIndex
- Start index in pixels array to start copying withvoid setTexturePixels(IPixelTexture2D texture, int x, int y, int width, int height, int[] pixels, int startIndex)
texture
- The texture to set pixels forx
- The x-coordinate of texture region in pixels to set pixels fory
- The y-coordinate of texture region in pixels to set pixels forwidth
- The width of texture region in pixels to set pixels forheight
- The height of texture region in pixels to set pixels forpixels
- The array with values of texture pixelsstartIndex
- Start index in pixels array to start copying withvoid drawCanvasTexture(ICanvasTexture2D texture, com.scichart.core.common.Action1<android.graphics.Canvas> drawingCommand)
Canvas
API. After executing command content of Canvas is rendered onto texture.
Texture for this call should be created by calling IAssetManager2D.createCanvasTexture(int, int)
methodtexture
- The target texture to draw ondrawingCommand
- The drawing command whichvoid drawRects(float[] points, int startIndex, int count, IPen2D pen)
points
- Array of points to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraypen
- The pen to draw rectangles withvoid fillRects(float[] points, int startIndex, int count, IBrush2D brush)
points
- Array of points to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraybrush
- The brush to fill rectangles withvoid drawEllipses(float[] points, int startIndex, int count, float width, float height, IPen2D strokePen, IBrush2D fillBrush)
points
- Array of points with centers to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraywidth
- The width of ellipses in pixelsheight
- The height of ellipses in pixelsstrokePen
- The pen to draw ellipse stroke withfillBrush
- The brush to fill ellipses withvoid drawEllipses(float[] points, int startIndex, int count, float width, float height, IPen2D strokePen)
points
- Array of points with centers to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraywidth
- The width of ellipses in pixelsheight
- The height of ellipses in pixelsstrokePen
- The pen to draw ellipse stroke withvoid drawEllipses(float[] points, int startIndex, int count, float width, float height, IBrush2D fillBrush)
points
- Array of points with centers to draw [x0 y0 x1 y1 ...]startIndex
- Start index in points array to start drawing withcount
- The amount of points to draw from points arraywidth
- The width of ellipses in pixelsheight
- The height of ellipses in pixelsfillBrush
- The brush to fill ellipses withvoid clear()
IRenderSurface
void save()
void restore()
translate(float, float)
,
rotate(float)
, scale(float, float)
and
setClipRect(float, float, float, float)
calls since the last save call.
It is an error to call restore() more times than save() was called.void translate(float dx, float dy)
IRenderContext2D
by specified x, y offsetdx
- The x offset in pixelsdy
- The y offset in pixelsvoid rotate(float degrees)
IRenderContext2D
on specified angledegrees
- The amount to rotate, in degreesvoid scale(float x, float y)
IRenderContext2D
by the provided x, y valuesx
- The amount to scale in x directiony
- The amount to scale in y directionvoid setClipRect(float left, float top, float right, float bottom)
IRenderContext2D
at specified coordinates in pixelsleft
- The left coordinate in pixelstop
- The top coordinate in pixelsright
- The right coordinate in pixelsbottom
- The bottom coordinate in pixelsvoid drawText(IFont font, float x, float y, int textColor, java.lang.String text)
font
- The IFont
instance to draw text withx
- The x-coordinate in pixelsy
- The y-coordinate in pixelstextColor
- The text colortext
- The text to drawITextDrawingContext beginTextDrawing(IFont font, int textColor)
IFont
instance and same text colorfont
- The IFont
instance to draw text withtextColor
- The text colorITextDrawingContext
to draw text width