public final class RegionRenderContextWrapper extends com.scichart.core.framework.DisposableBase implements IRenderContext2D
IRenderContext2D
implementation which allows to draw on some specified region of real IRenderContext2D
provided by IRenderSurface
Constructor and Description |
---|
RegionRenderContextWrapper() |
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 |
dispose() |
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 |
onBeginDrawing(IRenderContext2D renderContext,
boolean shouldFlip)
Inits drawing on real
IRenderContext2D instance with optional swap of x and y coordinates during drawing |
void |
onBeginDrawing(IRenderContext2D realRenderContext,
android.graphics.Rect bounds,
boolean clipToBounds)
Inits drawing in specified bounds of real
IRenderContext2D |
void |
onEndDrawing()
Ends the drawing with this instance on real
IRenderContext2D instance |
void |
restore()
This call balances a previous call to save(), and is used to remove all
modifications made by
IRenderContext2D.translate(float, float) ,
IRenderContext2D.rotate(float) , IRenderContext2D.scale(float, float) and
IRenderContext2D.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 |
close, tryDispose, tryDispose, tryDispose, tryDispose
public void onBeginDrawing(IRenderContext2D realRenderContext, android.graphics.Rect bounds, boolean clipToBounds)
IRenderContext2D
realRenderContext
- The real IRenderContext2D
instancebounds
- The bounds to draw inclipToBounds
- The value indicating whether we need to clip everything to the specified boundspublic void onBeginDrawing(IRenderContext2D renderContext, boolean shouldFlip)
IRenderContext2D
instance with optional swap of x and y coordinates during drawingrenderContext
- The real IRenderContext2D
instanceshouldFlip
- The value indicating whether we should swap x and y coordinates before drawingpublic void onEndDrawing()
IRenderContext2D
instancepublic int getViewportWidth()
getViewportWidth
in interface IRenderContext2D
public int getViewportHeight()
getViewportHeight
in interface IRenderContext2D
public void drawLine(float x1, float y1, float x2, float y2, IPen2D pen)
IRenderSurface
using the specified IPen2D
drawLine
in interface IRenderContext2D
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 withpublic void drawRect(float x1, float y1, float x2, float y2, IPen2D pen)
IRenderSurface
using the specified IPen2D
drawRect
in interface IRenderContext2D
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 withpublic void fillRect(float x1, float y1, float x2, float y2, IBrush2D brush)
IRenderSurface
using the specified IBrush2D
fillRect
in interface IRenderContext2D
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 withpublic void drawEllipse(float xCenter, float yCenter, float width, float height, IPen2D strokePen, IBrush2D fillBrush)
drawEllipse
in interface IRenderContext2D
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 withpublic void drawEllipse(float xCenter, float yCenter, float width, float height, IPen2D strokePen)
IRenderSurface
using the specified IPen2D
drawEllipse
in interface IRenderContext2D
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 withpublic void drawEllipse(float xCenter, float yCenter, float width, float height, IBrush2D fillBrush)
IRenderSurface
using the specified IBrush2D
drawEllipse
in interface IRenderContext2D
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 withpublic void drawSprite(ITexture2D sprite, float x, float y)
drawSprite
in interface IRenderContext2D
sprite
- The sprite to drawx
- The x-coordinate in pixelsy
- The y-coordinate in pixelspublic void drawSprite(ITexture2D sprite, float x, float y, float opacity)
drawSprite
in interface IRenderContext2D
sprite
- The sprite to drawx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsopacity
- The opacity to draw sprite withpublic IPathDrawingContext beginLine(IPen2D pen, float x, float y)
IPathDrawingContext
beginLine
in interface IRenderContext2D
pen
- The pen for line segmentx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsIPathDrawingContext
to continue the linepublic IPathDrawingContext beginTrianglesStrip(IBrush2D brush, float x, float y)
IPathDrawingContext
beginTrianglesStrip
in interface IRenderContext2D
brush
- The brush for triangle strips segmentx
- The x-coordinate in pixelsy
- The y-coordinate in pixelsIPathDrawingContext
to continue the linepublic void drawLines(float[] points, int startIndex, int count, IPen2D pen)
drawLines
in interface IRenderContext2D
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 withpublic void drawLinesStrip(float[] points, int startIndex, int count, IPen2D pen)
drawLinesStrip
in interface IRenderContext2D
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 withpublic void drawTrianglesStrip(float[] points, int startIndex, int count, IBrush2D brush)
drawTrianglesStrip
in interface IRenderContext2D
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 withpublic void drawSprites(ITexture2D sprite, float[] points, int startIndex, int count)
drawSprites
in interface IRenderContext2D
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 arraypublic void drawSprites(ITexture2D sprite, float[] points, int startIndex, int count, float opacity)
drawSprites
in interface IRenderContext2D
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 withpublic void drawRects(float[] points, int startIndex, int count, IPen2D pen)
drawRects
in interface IRenderContext2D
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 withpublic void fillRects(float[] points, int startIndex, int count, IBrush2D brush)
fillRects
in interface IRenderContext2D
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 withpublic void drawEllipses(float[] points, int startIndex, int count, float width, float height, IPen2D strokePen, IBrush2D fillBrush)
drawEllipses
in interface IRenderContext2D
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 withpublic void drawEllipses(float[] points, int startIndex, int count, float width, float height, IPen2D strokePen)
drawEllipses
in interface IRenderContext2D
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 withpublic void drawEllipses(float[] points, int startIndex, int count, float width, float height, IBrush2D fillBrush)
drawEllipses
in interface IRenderContext2D
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 withpublic void drawTexture(ITexture2D texture, float x1, float y1, float x2, float y2)
IRenderSurface
using the specified ITexture2D
drawTexture
in interface IRenderContext2D
texture
- The texture to drawx1
- The x1 coordinate in pixelsy1
- The y1 coordinate in pixelsx2
- The x2 coordinate in pixelsy2
- The y2 coordinate in pixelspublic void drawTexture(ITexture2D texture, float x1, float y1, float x2, float y2, float opacity)
IRenderSurface
using the specified ITexture2D
drawTexture
in interface IRenderContext2D
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 withpublic void drawTexture(ITexture2D texture, float[] points, int startIndex, int count)
drawTexture
in interface IRenderContext2D
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 arraypublic void drawTexture(ITexture2D texture, float[] points, int startIndex, int count, float opacity)
drawTexture
in interface IRenderContext2D
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 withpublic void setTexturePixels(IPixelTexture2D texture, int[] pixels, int startIndex)
setTexturePixels
in interface IRenderContext2D
texture
- The texture to set pixels forpixels
- The array with values of texture pixelsstartIndex
- Start index in pixels array to start copying withpublic void setTexturePixels(IPixelTexture2D texture, int x, int y, int width, int height, int[] pixels, int startIndex)
setTexturePixels
in interface IRenderContext2D
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 withpublic void 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)
methoddrawCanvasTexture
in interface IRenderContext2D
texture
- The target texture to draw ondrawingCommand
- The drawing command whichpublic void clear()
IRenderSurface
clear
in interface IRenderContext2D
public void translate(float dx, float dy)
IRenderContext2D
by specified x, y offsettranslate
in interface IRenderContext2D
dx
- The x offset in pixelsdy
- The y offset in pixelspublic void scale(float x, float y)
IRenderContext2D
by the provided x, y valuesscale
in interface IRenderContext2D
x
- The amount to scale in x directiony
- The amount to scale in y directionpublic void rotate(float degrees)
IRenderContext2D
on specified anglerotate
in interface IRenderContext2D
degrees
- The amount to rotate, in degreespublic void setClipRect(float left, float top, float right, float bottom)
IRenderContext2D
at specified coordinates in pixelssetClipRect
in interface IRenderContext2D
left
- The left coordinate in pixelstop
- The top coordinate in pixelsright
- The right coordinate in pixelsbottom
- The bottom coordinate in pixelspublic void save()
save
in interface IRenderContext2D
public void restore()
IRenderContext2D.translate(float, float)
,
IRenderContext2D.rotate(float)
, IRenderContext2D.scale(float, float)
and
IRenderContext2D.setClipRect(float, float, float, float)
calls since the last save call.
It is an error to call restore() more times than save() was called.restore
in interface IRenderContext2D
public void drawText(IFont font, float x, float y, int textColor, java.lang.String text)
drawText
in interface IRenderContext2D
font
- The IFont
instance to draw text withx
- The x-coordinate in pixelsy
- The y-coordinate in pixelstextColor
- The text colortext
- The text to drawpublic ITextDrawingContext beginTextDrawing(IFont font, int textColor)
IFont
instance and same text colorbeginTextDrawing
in interface IRenderContext2D
font
- The IFont
instance to draw text withtextColor
- The text colorITextDrawingContext
to draw text widthpublic void dispose()
dispose
in interface com.scichart.core.framework.IDisposable