An image node style for use in WebGL2 rendering.
Remarks
Type Details
- yFiles module
- view
See Also
Constructors
WebGLImageNodeStyle
(image: ImageData, imageColor?: Color, preserveAspectRatio?: boolean, backgroundShape?: WebGLShapeNodeShape, backgroundFill?: Color, backgroundStroke?: WebGLStroke, effect?: WebGLEffect, textureRendering?: WebGLTextureRendering)Creates a new image node style that is rendered with WebGL2.
Remarks
This style can be applied to nodes that are rendered by the WebGLGraphModelManager.
The preferred way of calling the constructor is using option arguments, as there are many defaults and optional arguments. To use the default value for a color option, set it to null
.
Parameters
A map of options to pass to the method.
- image - ImageData
- The mandatory image data for the image.
- imageColor - Color
- The fill color of the image, or
null
. If this parameter isnull
, the original color of the image is used. Otherwise, the alpha values of the image will be combined with the color values from this value. Defaults tonull
. - preserveAspectRatio - boolean
- Whether to preserve the image aspect ratio. Defaults to
false
. - backgroundShape - WebGLShapeNodeShape
- The shape of the node. Defaults to ELLIPSE.
- backgroundFill - Color
- The background color of the node. Defaults to WHITE.
- backgroundStroke - WebGLStroke
- The border color of the node. Defaults to BLACK.
- effect - WebGLEffect
- The effect around the node. Defaults to NONE.
- textureRendering - WebGLTextureRendering
- Rendering hint on how to resolve blurriness of images on large zoom values. Defaults to INTERPOLATED We recommend not using SDF for images that contain gradients.
Properties
Gets the fill color for the background shape.
Gets the background shape of the style.
Gets the stroke around the background shape.
Gets the set of applied effects on this style.
Gets the ImageData of the image.
Gets the fill color for the image, or null
.
Remarks
null
is specified, the original color of the image is used. Setting this to a non-null value will use the alpha values from the image and combine them with the RGB color specified here.See Also
Gets a value that specifies whether to preserve the aspect ratio of the image and the backgroundShape.
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given node and this style instance.
Remarks
const creator = style.renderer.getVisualCreator(node, style)
const visual = creator.createVisual(context)
See Also
Implements
Gets the rendering hint on how to resolve blurriness of images on large zoom values.
Remarks
Methods
Create a clone of this object.