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 | |
preserveImageAspect | Switch to preserve image aspect. |
Functions | |
getSvgScreenOffset | Disables offset in IE9 for crisper image output. |
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. |
isHtmlAllowed | Returns true if HTML is allowed for this shape. |
createHtml | Creates and returns the HTML DOM node(s) to represent this shape. |
isRoundable | Disables inherited roundable support. |
paintVertexShape | Generic background painting implementation. |
redraw | Overrides mxShape.redraw to preserve the aspect ratio of 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.redrawHtmlShape = function()
Overrides mxShape.redraw to preserve the aspect ratio of images.
Constructs a new image shape.
function mxImageShape( bounds, image, fill, stroke, strokewidth )
Switch to preserve image aspect.
mxImageShape.prototype.preserveImageAspect
Disables offset in IE9 for crisper image output.
mxImageShape.prototype.getSvgScreenOffset = function()
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 )
Defines the key for the image background color.
STYLE_IMAGE_BACKGROUND: 'imageBackground'
Defines the key for the image border color.
STYLE_IMAGE_BORDER: 'imageBorder'
Returns true if HTML is allowed for this shape.
mxImageShape.prototype.isHtmlAllowed = function()
Creates and returns the HTML DOM node(s) to represent this shape.
mxImageShape.prototype.createHtml = function()
Disables inherited roundable support.
mxImageShape.prototype.isRoundable = function( c, x, y, w, h )
Generic background painting implementation.
mxImageShape.prototype.paintVertexShape = function( c, x, y, w, h )
Overrides mxShape.redraw to preserve the aspect ratio of images.
mxImageShape.prototype.redrawHtmlShape = function()
Creates and returns the SVG node(s) to represent this shape.
mxShape.prototype.redraw = function()
Name under which mxImageShape is registered in mxCellRenderer.
SHAPE_IMAGE: 'image'
Holds the mxRectangle that specifies the bounds of this shape.
mxShape.prototype.bounds