iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
ISCIRenderContext2D
@protocol ISCIRenderContext2D <ISCIDisposable>
Defines the protocol to a 2D RenderContext, allowing rendering of pens, brushes, sprites and textures on the ISCIRenderSurface.
-
The viewport size in user space coordinate system.
Declaration
Objective-C
@property (nonatomic, readonly) CGSize viewportSize;Swift
var viewportSize: CGSize { get }
-
Begins a line segment, returning the
ISCIPathDrawingContext.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (nonnull id<ISCIPathDrawingContext>)beginLineWithPen: (nonnull id<ISCIPen2D>)pen at:(CGPoint)point;Swift
func beginLine(with pen: any ISCIPen2D, at point: CGPoint) -> any ISCIPathDrawingContextParameters
penThe pen for line segment.
pointThe point coordinates.
Return Value
The
ISCIPathDrawingContextto continue the line. -
Draws a single line on the
ISCIRenderSurfaceusing the specifiedISCIPen2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawLineWithPen:(nonnull id<ISCIPen2D>)pen atStart:(CGPoint)start end:(CGPoint)end;Swift
func drawLine(with pen: any ISCIPen2D, at start: CGPoint, end: CGPoint)Parameters
penThe pen to draw line with.
startThe start point coordinates.
endThe end point coordinates.
-
Draws a series of lines. Each line is taken from 4 consecutive values in the points array. Thus to draw 1 line, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawLinesWithPen:(nonnull id<ISCIPen2D>)pen points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
penThe pen to draw lines with.
pointsArray of points to draw
[x0, y0, x1, y1, x2, y2 ...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a lines strip. Each line is taken from 4 consecutive values in the points array. Thus to draw 1 line, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawLinesStripWithPen:(nonnull id<ISCIPen2D>)pen points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
penThe pen to draw lines with.
pointsArray of points to draw
[x0, y0, x1, y1, x2, y2 ...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Begins a filled triangle strips segment, returning the
ISCIPathDrawingContext.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (nonnull id<ISCIPathDrawingContext>) beginTrianglesStripWithBrush:(nonnull id<ISCIBrush2D>)brush at:(CGPoint)point;Swift
func beginTrianglesStrip(with brush: any ISCIBrush2D, at point: CGPoint) -> any ISCIPathDrawingContextParameters
brushThe brush for triangle strips segment.
pointThe point coordinates.
Return Value
The
ISCIPathDrawingContextto continue the line. -
Draws a triangle strip. Each line is taken from 6 consecutive values in the points array. Thus to draw 1 triangle, the array must contain at least 6 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawTrianglesStripWithBrush:(nonnull id<ISCIBrush2D>)brush points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
brushThe brush to fill triangles with.
pointsArray of points to draw
[x0, y0, x1, y1, x2, y2 ...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a single rectangle on the
ISCIRenderSurfaceusing the specifiedISCIPen2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawRect:(CGRect)rect withPen:(nonnull id<ISCIPen2D>)pen;Swift
func drawRect(_ rect: CGRect, with pen: any ISCIPen2D)Parameters
rectThe CGRect coordinates.
penThe pen to draw rect with.
-
Fills a single rectangle on the
ISCIRenderSurfaceusing the specifiedISCIBrush2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)fillRect:(CGRect)rect withBrush:(nonnull id<ISCIBrush2D>)brush;Swift
func fillRect(_ rect: CGRect, with brush: any ISCIBrush2D)Parameters
rectThe CGRect coordinates.
brushThe brush to fill rectangle with.
-
Draws a single rounded rectangle on the
ISCIRenderSurface.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawRoundedRect:(CGRect)rect withPen:(nullable id<ISCIPen2D>)pen andBrush:(nullable id<ISCIBrush2D>)brush topRadius:(CGFloat)topRadius bottomRadius:(CGFloat)bottomRadius;Parameters
rectThe CGRect coordinates.
penThe pen to draw rectangle outline with.
brushThe brush to fill rectangle with.
topRadiusThe radius which will be used for top-left and top-right corners.
bottomRadiusThe radius which will be used for bottom-left and bottom-right corners.
-
Draws a series of rectangles. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 rectangle, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawRectsWithPen:(nonnull id<ISCIPen2D>)pen points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
penThe pen to draw rectangles with.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Fills a series of rectangles. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 rectangle, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)fillRectsWithBrush:(nonnull id<ISCIBrush2D>)brush points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
brushThe brush to fill rectangles with.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a series of rounded rectangles. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 rectangle, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawRoundedRects:(nonnull const float *)points startIndex:(int)startIndex count:(int)count withPen:(nullable id<ISCIPen2D>)pen andBrush:(nullable id<ISCIBrush2D>)brush topRadius:(CGFloat)topRadius bottomRadius:(CGFloat)bottomRadius;Parameters
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
penThe pen to draw rectangles outline with.
brushThe brush to fill rectangles with.
topRadiusThe radius which will be used for top-left and top-right corners.
bottomRadiusThe radius which will be used for bottom-left and bottom-right corners.
-
Draws a single ellipse on the
ISCIRenderSurfaceusing the specifiedISCIPen2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawEllipseWithPen:(nonnull id<ISCIPen2D>)pen andSize:(CGSize)size at:(CGPoint)center;Swift
func drawEllipse(with pen: any ISCIPen2D, andSize size: CGSize, at center: CGPoint)Parameters
penThe pen to draw ellipse stroke with.
sizeThe size of ellipse.
centerThe center coordinates.
-
Draws a single ellipse on the
ISCIRenderSurfaceusing the specifiedISCIBrush2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)fillEllipseWithBrush:(nonnull id<ISCIBrush2D>)brush andSize:(CGSize)size at:(CGPoint)center;Swift
func fillEllipse(with brush: any ISCIBrush2D, andSize size: CGSize, at center: CGPoint)Parameters
brushThe brush to fill ellipse with.
sizeThe size of ellipse.
centerThe center coordinates.
-
Draws a single ellipse on the
ISCIRenderSurfaceusing the specifiedISCIBrush2DandISCIPen2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawEllipseWithPen:(nonnull id<ISCIPen2D>)pen brush:(nonnull id<ISCIBrush2D>)brush andSize:(CGSize)size at:(CGPoint)center;Swift
func drawEllipse(with pen: any ISCIPen2D, brush: any ISCIBrush2D, andSize size: CGSize, at center: CGPoint)Parameters
penThe pen to draw ellipse stroke with.
brushThe brush to fill ellipse with.
sizeThe size of ellipse.
centerThe center coordinates.
-
Draws a series of ellipses. Each point for sprite is taken from 4 consecutive values in the points array representing rectangle in which each ellipse will be drawn. Thus to draw 1 ellipse, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawEllipsesWithPen:(nonnull id<ISCIPen2D>)pen points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
penThe pen to draw ellipse stroke with.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a series of ellipses. Each point for sprite is taken from 4 consecutive values in the points array representing rectangle in which each ellipse will be drawn. Thus to draw 1 ellipse, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.*Declaration
Objective-C
- (void)fillEllipsesWithBrush:(nonnull id<ISCIBrush2D>)brush points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
brushThe brush to fill ellipses with.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a series of ellipses. Each point for sprite is taken from 4 consecutive values in the points array representing rectangle in which each ellipse will be drawn. Thus to draw 1 ellipse, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawEllipsesWithPen:(nonnull id<ISCIPen2D>)pen brush:(nonnull id<ISCIBrush2D>)brush points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
penThe pen to draw ellipse stroke with.
brushThe brush to fill ellipses with.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Fills a single rectangle on the
ISCIRenderSurfaceusing the specifiedISCITexture2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawTexture:(nonnull id<ISCITexture2D>)texture inRect:(CGRect)rect;Parameters
textureThe texture to draw.
rectThe rect coordinates to draw texture in.
-
Fills a single rectangle on the
ISCIRenderSurfaceusing the specifiedISCITexture2D.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawTexture:(nonnull id<ISCITexture2D>)texture inRect:(CGRect)rect withOpacity:(float)opacity;Parameters
textureThe texture to draw.
rectThe rect coordinates to draw texture in.
opacityThe opacity to draw texture with.
-
Draws a series of textures. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 texture, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.*Declaration
Objective-C
- (void)drawTextures:(nonnull id<ISCITexture2D>)texture points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
textureThe texture to draw.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a series of textures. Each point for sprite is taken from 4 consecutive values in the points array. Thus to draw 1 texture, the array must contain at least 4 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawTextures:(nonnull id<ISCITexture2D>)texture points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count opacity:(float)opacity;Parameters
textureThe texture to draw.
pointsArray of points to draw
[x0, y0, x1, y1...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
opacityThe opacity to draw texture with.
-
Sets the texture pixels based on values provided by pixels array.
Declaration
Objective-C
- (void)updateTexture:(nonnull id<ISCITexture2D>)texture withPixels:(nonnull unsigned int *)pixels;Swift
func update(_ texture: any ISCITexture2D, withPixels pixels: UnsafeMutablePointer<UInt32>)Parameters
textureThe texture to set pixels for.
pixelsThe array with values of texture pixels.
-
Sets the region of texture pixels based on values provided by pixels array.
Declaration
Objective-C
- (void)updateFloatTexture:(nonnull id<ISCITexture2D>)texture withPixels:(nonnull float *)pixels;Swift
func updateFloat(_ texture: any ISCITexture2D, withPixels pixels: UnsafeMutablePointer<Float>)Parameters
textureThe texture to set pixels for.
pixelsThe array with values of texture pixels.
-
Draws a sprite at specified
x, ycoordinate.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawSprite:(nonnull id<ISCITexture2D>)sprite at:(CGPoint)point;Swift
func drawSprite(_ sprite: any ISCITexture2D, at point: CGPoint)Parameters
spriteThe sprite to draw.
pointThe sprite coordinates.
-
Draws a sprite at specified
x, ycoordinate.Note
Please note, that coordinates should be provided in user space coordinate system.*Declaration
Objective-C
- (void)drawSprite:(nonnull id<ISCITexture2D>)sprite at:(CGPoint)point withOpacity:(float)opacity;Swift
func drawSprite(_ sprite: any ISCITexture2D, at point: CGPoint, withOpacity opacity: Float)Parameters
spriteThe sprite to draw.
pointThe sprite coordinates.
opacityThe opacity to draw sprite with.
-
Draws a series of sprites. Each point for sprite is taken from 2 consecutive values in the points array. Thus to draw 1 sprite, the array must contain at least 2 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawSprites:(nonnull id<ISCITexture2D>)sprite points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count;Parameters
spriteThe spite to draw.
pointsArray of points to draw
[x0, y0, x1, y1, x2, y2 ...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
-
Draws a series of sprites. Each point for sprite is taken from 2 consecutive values in the points array. Thus to draw 1 sprite, the array must contain at least 2 values.
Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawSprites:(nonnull id<ISCITexture2D>)sprite points:(nonnull const float *)points startIndex:(int)startIndex count:(int)count opacity:(float)opacity;Parameters
spriteThe spite to draw.
pointsArray of points to draw
[x0, y0, x1, y1, x2, y2 ...].startIndexStart index in points array to start drawing with.
countThe amount of points to draw from points array.
opacityThe opacity to draw sprite with.
-
Draws a single heatmap on the
ISCIRenderSurfaceusing the specified float texture and gradient color map.Note
Please note, that coordinates should be provided in user space coordinate system.Declaration
Objective-C
- (void)drawHeatmapTexure:(nonnull id<ISCITexture2D>)heatmap inRect:(CGRect)rect withColorMapTexture:(nonnull id<ISCITexture2D>)colorMap min:(double)min andMax:(double)max;Swift
func drawHeatmapTexure(_ heatmap: any ISCITexture2D, in rect: CGRect, withColorMapTexture colorMap: any ISCITexture2D, min: Double, andMax max: Double)Parameters
heatmapThe heatmap texture with normalized float values which will be converted to colors using
colorMap.rectThe rect coordinates to draw texture in.
colorMapThe colorMap texture, which will be used to calculate colors for heatmap normalized values.
minThe minimum value for this heatmap texture.
maxThe maximum value for this heatmap texture.
-
Saves the current transformation and clip rect onto a private stack.
Declaration
Objective-C
- (void)save;Swift
func save() -
This call balances a previous call to
-save. It’s used to remove all modifications made by-translateXBy:yBy:,rotateByDegrees:,-scaleXBy:yBy:and-setClipRect:calls since the last save call.Declaration
Objective-C
- (void)restore;Swift
func restore() -
Translates this
ISCIRenderContext2Dby specified x, y offset.Declaration
Objective-C
- (void)translateXBy:(float)deltaX yBy:(float)deltaY;Swift
func translateBy(x deltaX: Float, y deltaY: Float)Parameters
deltaXThe x offset in pixels.
deltaYThe y offset in pixels.
-
Rotates this
ISCIRenderContext2Don specified angle.Declaration
Objective-C
- (void)rotateByDegrees:(float)angle;Swift
func rotate(by angle: Float)Parameters
angleThe amount to rotate, in degrees.
-
Scales this
ISCIRenderContext2Dby the provided x, y values.Declaration
Objective-C
- (void)scaleXBy:(float)scaleX yBy:(float)scaleY;Swift
func scaleBy(x scaleX: Float, y scaleY: Float)Parameters
scaleXThe amount to scale in x direction.
scaleYThe amount to scale in y direction.
-
Sets clip rect for this
ISCIRenderContext2Dat specified coordinates in pixels.Declaration
Objective-C
- (void)setClipRect:(CGRect)clipRect;Swift
func setClipRect(_ clipRect: CGRect)Parameters
clipRectThe rect which will be used to clip this render context.
-
Clears the
ISCIRenderSurface.Declaration
Objective-C
- (void)clear;Swift
func clear()
View on GitHub