public class CImage extends CShape
Canvas
.
The image is loaded from a file and can be in any format recognized by Java2D.
The fill paint is ignored.
If the shape is outlined, the border of the image is drawn according to the outline paint and stroke.Constructor and Description |
---|
CImage(java.awt.image.BufferedImage image,
java.awt.geom.Point2D loc)
Builds a CImage.
|
CImage(java.io.InputStream imageStream,
java.awt.geom.Point2D loc)
Builds a CImage.
|
CImage(java.lang.String imageFile,
java.awt.geom.Point2D loc)
Builds a CImage.
|
CImage(java.net.URL imageURL,
java.awt.geom.Point2D loc)
Builds a CImage.
|
Modifier and Type | Method and Description |
---|---|
CShape |
copyTo(CShape sms)
Copies this shape into a destination shape.
|
CShape |
duplicate()
Creates a new copy of this shape and returns it.
|
void |
paint(java.awt.Graphics g)
Paints the shape.
|
above, aboveAll, addChild, addGhost, addTag, addTag, addTag, addTo, animate, asEllipse, asImage, asPolyLine, asRectangle, asRectangularShape, asText, attachSM, below, belowAll, canvasToShape, canvasToShapeRef, clone, contains, contains, contains, contains, detachSM, duplicateWithTags, firstShape, fixReferenceShapeToCurrent, getAbsShape, getAbsTransform, getAntialiasedShapes, getBoundingBox, getCanvas, getCenterX, getCenterY, getChild, getChildren, getChildrenCount, getClip, getFilledShapes, getFillPaint, getFirstAntialiasedShape, getFirstFilledShape, getFirstHavingTag, getFirstOutlinedShape, getGhost, getHeight, getHierarchy, getIntersection, getMaxX, getMaxY, getMinX, getMinY, getOutlinedShapes, getOutlinePaint, getParent, getReferenceX, getReferenceY, getRenderingHint, getRotation, getScaleX, getScaleY, getShape, getStroke, getSubtraction, getTags, getTransform, getTranslateX, getTranslateY, getTransparencyFill, getTransparencyOutline, getWidth, hasTag, hasTag, indexOf, intersects, isAbove, isAntialiased, isBelow, isDrawable, isFilled, isOnOutline, isOutlined, isPickable, isPicked, pick, pickStyle, remove, removeAllChildren, removeChild, removeChild, removeGhost, removeTag, removeTag, rotateBy, rotateTo, scaleBy, scaleBy, scaleTo, scaleTo, setAntialiased, setClip, setDrawable, setFilled, setFillPaint, setOutlined, setOutlinePaint, setParent, setPickable, setReferencePoint, setReferencePoint, setRenderingHint, setShape, setStroke, setTransformToIdentity, setTransparencyFill, setTransparencyFill, setTransparencyOutline, setTransparencyOutline, shapeToCanvas, translateBy, translateTo
public CImage(java.awt.image.BufferedImage image, java.awt.geom.Point2D loc)
image
- The imageloc
- The location of the lower left corner of the imagepublic CImage(java.lang.String imageFile, java.awt.geom.Point2D loc)
imageFile
- The name of the file image (gif, jpeg or png)loc
- The location of the lower left corner of the imagepublic CImage(java.net.URL imageURL, java.awt.geom.Point2D loc)
imageURL
- The url where to read the imageloc
- The location of the lower left corner of the imagepublic CImage(java.io.InputStream imageStream, java.awt.geom.Point2D loc)
imageStream
- The stream where to read the imageloc
- The location of the lower left corner of the imagepublic void paint(java.awt.Graphics g)
public CShape copyTo(CShape sms)
copyTo
in class CShape
sms
- The destination shapeCShape.copyTo(fr.lri.swingstates.canvas.CShape)
public CShape duplicate()
duplicate
in class CShape
CShape.duplicateWithTags()