addFill
To populate various fill styles to use with CAD polygons.
Syntax
Syntax: RxCore.addFill(type, name, image, tilesize, color, ledgend_description)
Parameters
type
: string — Should be'hatch'
or'color'
name
: string — The name of the fill entryimage
: HTMLImage or null — Used for hatch as fill repeat imagetilesize
: object —{w: number, h: number}
size of the hatch image in pixelscolor
: HTMLColor — Color of the hatch or color fillledgend_description
: string — Description for the legend displayed with the drawing
Returns
- NA — This method does not return a value.
Example
Example:
// Red fill color with 0.5 transparency
RxCore.addFill('color', 'transpred', null, null, 'rgba(255,0,0,0.5)', 'BTA');
// Adding a hatch using an image of 16x16 pixels
RxCore.addFill('hatch', 'diagonal-forward', image,{w:16, h:16},
'rgba(255,0,0,0.5)', 'Non usable space');