Extends mxShape to implement an image shape. This shape is registered under mxConstants.SHAPE_IMAGE in mxCellRenderer.
mxImageShape | Extends mxShape to implement an image shape. |
Functions | |
mxImageShape | Constructs a new image shape. |
Variables | |
crisp | Disables crisp rendering via attributes. |
preserveImageAspect | Switch to preserve image aspect. |
Functions | |
apply | Overrides mxShape.apply to replace the fill and stroke colors with the respective values from mxConstants.STYLE_IMAGE_BACKGROUND and mxConstants.STYLE_IMAGE_BORDER. |
create | Override to create HTML regardless of gradient and rounded property. |
updateAspect | Updates the aspect of the image for the given image width and height. |
scheduleUpdateAspect | Schedules an asynchronous updateAspect using the current <image>. |
redraw | Overrides mxShape.redraw to preserve the aspect ratio of images. |
configureTransparentBackground | Workaround for security warning in IE if this is used in the overlay pane of a diagram. |
redrawSvg | Updates the SVG node(s) to reflect the latest bounds and scale. |
configureSvgShape | Extends method to set opacity on images. |
function mxImageShape( bounds, image, fill, stroke, strokewidth )
Constructs a new image shape.
bounds | mxRectangle that defines the bounds. This is stored in mxShape.bounds. |
image | String that specifies the URL of the image. This is stored in <image>. |
fill | String that defines the fill color. This is stored in <fill>. |
stroke | String that defines the stroke color. This is stored in <stroke>. |
strokewidth | Optional integer that defines the stroke width. Default is 0. This is stored in <strokewidth>. |
mxImageShape.prototype.apply = function( state )
Overrides mxShape.apply to replace the fill and stroke colors with the respective values from mxConstants.STYLE_IMAGE_BACKGROUND and mxConstants.STYLE_IMAGE_BORDER.
Applies the style of the given mxCellState to the shape. This implementation assigns the following styles to local fields:
state | mxCellState of the corresponding cell. |
mxImageShape.prototype.scheduleUpdateAspect = function()
Schedules an asynchronous updateAspect using the current <image>.
mxImageShape.prototype.redraw = function()
Overrides mxShape.redraw to preserve the aspect ratio of images.
Constructs a new image shape.
function mxImageShape( bounds, image, fill, stroke, strokewidth )
Disables crisp rendering via attributes.
mxImageShape.prototype.crisp
Switch to preserve image aspect.
mxImageShape.prototype.preserveImageAspect
Overrides mxShape.apply to replace the fill and stroke colors with the respective values from mxConstants.STYLE_IMAGE_BACKGROUND and mxConstants.STYLE_IMAGE_BORDER.
mxImageShape.prototype.apply = function( state )
Applies the style of the given mxCellState to the shape.
mxShape.prototype.apply = function( state )
Override to create HTML regardless of gradient and rounded property.
mxImageShape.prototype.create = function()
Updates the aspect of the image for the given image width and height.
mxImageShape.prototype.updateAspect = function( w, h )
Schedules an asynchronous updateAspect using the current image.
mxImageShape.prototype.scheduleUpdateAspect = function()
Overrides mxShape.redraw to preserve the aspect ratio of images.
mxImageShape.prototype.redraw = function()
Invokes redrawSvg, redrawVml or redrawHtml depending on the dialect of the shape.
mxShape.prototype.redraw = function()
Workaround for security warning in IE if this is used in the overlay pane of a diagram.
mxImageShape.prototype.configureTransparentBackground = function( node )
Updates the SVG node(s) to reflect the latest bounds and scale.
mxImageShape.prototype.redrawSvg = function()
Extends method to set opacity on images.
mxImageShape.prototype.configureSvgShape = function( node )
Holds the mxRectangle that specifies the bounds of this shape.
mxShape.prototype.bounds