mxImageShape

Extends mxShape to implement an image shape.  This shape is registered under mxConstants.SHAPE_IMAGE in mxCellRenderer.

Summary
mxImageShapeExtends mxShape to implement an image shape.
Functions
mxImageShapeConstructs a new image shape.
Variables
preserveImageAspectSwitch to preserve image aspect.
Functions
getSvgScreenOffsetDisables offset in IE9 for crisper image output.
applyOverrides mxShape.apply to replace the fill and stroke colors with the respective values from mxConstants.STYLE_IMAGE_BACKGROUND and mxConstants.STYLE_IMAGE_BORDER.
isHtmlAllowedReturns true if HTML is allowed for this shape.
createHtmlCreates and returns the HTML DOM node(s) to represent this shape.
isRoundableDisables inherited roundable support.
paintVertexShapeGeneric background painting implementation.
redrawOverrides mxShape.redraw to preserve the aspect ratio of images.

Functions

mxImageShape

function mxImageShape(bounds,
image,
fill,
stroke,
strokewidth)

Constructs a new image shape.

Parameters

boundsmxRectangle that defines the bounds.  This is stored in mxShape.bounds.
imageString that specifies the URL of the image.  This is stored in <image>.
fillString that defines the fill color.  This is stored in <fill>.
strokeString that defines the stroke color.  This is stored in <stroke>.
strokewidthOptional integer that defines the stroke width.  Default is 0.  This is stored in <strokewidth>.

Variables

preserveImageAspect

mxImageShape.prototype.preserveImageAspect

Switch to preserve image aspect.  Default is true.

Functions

getSvgScreenOffset

mxImageShape.prototype.getSvgScreenOffset = function()

Disables offset in IE9 for crisper image output.

apply

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:

Parameters

statemxCellState of the corresponding cell.

isHtmlAllowed

mxImageShape.prototype.isHtmlAllowed = function()

Returns true if HTML is allowed for this shape.  This implementation always returns false.

createHtml

mxImageShape.prototype.createHtml = function()

Creates and returns the HTML DOM node(s) to represent this shape.  This implementation falls back to <createVml> so that the HTML creation is optional.

isRoundable

mxImageShape.prototype.isRoundable = function(c,
x,
y,
w,
h)

Disables inherited roundable support.

paintVertexShape

mxImageShape.prototype.paintVertexShape = function(c,
x,
y,
w,
h)

Generic background painting implementation.

redraw

mxImageShape.prototype.redrawHtmlShape = function()

Overrides mxShape.redraw to preserve the aspect ratio of images.

Base class for all shapes.
function mxImageShape(bounds,
image,
fill,
stroke,
strokewidth)
Constructs a new image shape.
mxImageShape.prototype.preserveImageAspect
Switch to preserve image aspect.
mxImageShape.prototype.getSvgScreenOffset = function()
Disables offset in IE9 for crisper image output.
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.
mxShape.prototype.apply = function(state)
Applies the style of the given mxCellState to the shape.
STYLE_IMAGE_BACKGROUND: 'imageBackground'
Defines the key for the image background color.
STYLE_IMAGE_BORDER: 'imageBorder'
Defines the key for the image border color.
mxImageShape.prototype.isHtmlAllowed = function()
Returns true if HTML is allowed for this shape.
mxImageShape.prototype.createHtml = function()
Creates and returns the HTML DOM node(s) to represent this shape.
mxImageShape.prototype.isRoundable = function(c,
x,
y,
w,
h)
Disables inherited roundable support.
mxImageShape.prototype.paintVertexShape = function(c,
x,
y,
w,
h)
Generic background painting implementation.
mxImageShape.prototype.redrawHtmlShape = function()
Overrides mxShape.redraw to preserve the aspect ratio of images.
mxShape.prototype.redraw = function()
Creates and returns the SVG node(s) to represent this shape.
SHAPE_IMAGE: 'image'
Name under which mxImageShape is registered in mxCellRenderer.
Renders cells into a document object model.
Extends mxPoint to implement a 2-dimensional rectangle with double precision coordinates.
mxShape.prototype.bounds
Holds the mxRectangle that specifies the bounds of this shape.
Represents the current state of a cell in a given mxGraphView.
Close