Package jxl.write
Class WritableImage
java.lang.Object
jxl.biff.drawing.Drawing
jxl.write.WritableImage
- All Implemented Interfaces:
jxl.biff.drawing.DrawingGroupObject,Image
public class WritableImage
extends jxl.biff.drawing.Drawing
Allows an image to be created, or an existing image to be manipulated
Note that co-ordinates and dimensions are given in cells, so that if for
example the width or height of a cell which the image spans is altered,
the image will have a correspondign distortion
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic jxl.biff.drawing.Drawing.ImageAnchorPropertiesImage anchor properties which will move and resize an image along with the cellsstatic jxl.biff.drawing.Drawing.ImageAnchorPropertiesImage anchor properties which will move an image when cells are inserted or deletedstatic jxl.biff.drawing.Drawing.ImageAnchorPropertiesImage anchor properties which will leave an image unaffected when other cells are inserted, removed or resized -
Constructor Summary
ConstructorsConstructorDescriptionWritableImage(double x, double y, double width, double height, byte[] imageData) ConstructorWritableImage(double x, double y, double width, double height, File image) ConstructorWritableImage(jxl.biff.drawing.DrawingGroupObject d, jxl.biff.drawing.DrawingGroup dg) Constructor, used when copying sheets -
Method Summary
Modifier and TypeMethodDescriptiondoubleAccessor for the image positiondoubleAccessor for the image dimensionsjxl.biff.drawing.Drawing.ImageAnchorPropertiesAccessor for the anchor propertiesbyte[]Accessor for the image dataAccessor for the image filedoublegetRow()Accessor for the image positiondoublegetWidth()Accessor for the image dimensionsvoidsetColumn(double c) Accessor for the image positionvoidsetHeight(double c) Accessor for the image dimensions Note that the actual size of the rendered image will depend on the height of the rows it spansvoidsetImageAnchor(jxl.biff.drawing.Drawing.ImageAnchorProperties iap) Accessor for the anchor propertiesvoidsetRow(double c) Accessor for the image positionvoidsetWidth(double c) Accessor for the image dimensions Note that the actual size of the rendered image will depend on the width of the columns it spansMethods inherited from class jxl.biff.drawing.Drawing
getBlipId, getDrawingGroup, getHeight, getHorizontalResolution, getImageBytes, getImageFilePath, getImageHeight, getImageWidth, getMsoDrawingRecord, getObjectId, getOrigin, getReferenceCount, getShapeId, getSpContainer, getType, getVerticalResolution, getWidth, getX, getY, isFirst, isFormObject, removeRow, setDrawingGroup, setObjectId, setReferenceCount, setX, setY, writeAdditionalRecords, writeTailRecords
-
Field Details
-
MOVE_AND_SIZE_WITH_CELLS
public static jxl.biff.drawing.Drawing.ImageAnchorProperties MOVE_AND_SIZE_WITH_CELLSImage anchor properties which will move and resize an image along with the cells -
MOVE_WITH_CELLS
public static jxl.biff.drawing.Drawing.ImageAnchorProperties MOVE_WITH_CELLSImage anchor properties which will move an image when cells are inserted or deleted -
NO_MOVE_OR_SIZE_WITH_CELLS
public static jxl.biff.drawing.Drawing.ImageAnchorProperties NO_MOVE_OR_SIZE_WITH_CELLSImage anchor properties which will leave an image unaffected when other cells are inserted, removed or resized
-
-
Constructor Details
-
WritableImage
Constructor- Parameters:
x- the column number at which to position the imagey- the row number at which to position the imagewidth- the number of columns cells which the image spansheight- the number of rows which the image spansimage- the source image file
-
WritableImage
public WritableImage(double x, double y, double width, double height, byte[] imageData) Constructor- Parameters:
x- the column number at which to position the imagey- the row number at which to position the imagewidth- the number of columns cells which the image spansheight- the number of rows which the image spansimageData- the image data
-
WritableImage
public WritableImage(jxl.biff.drawing.DrawingGroupObject d, jxl.biff.drawing.DrawingGroup dg) Constructor, used when copying sheets- Parameters:
d- the image to copydg- the drawing group
-
-
Method Details
-
getColumn
public double getColumn()Accessor for the image position -
setColumn
public void setColumn(double c) Accessor for the image position- Parameters:
c- the column number at which the image should be positioned
-
getRow
public double getRow()Accessor for the image position -
setRow
public void setRow(double c) Accessor for the image position- Parameters:
c- the row number at which the image should be positioned
-
getWidth
public double getWidth()Accessor for the image dimensions -
setWidth
public void setWidth(double c) Accessor for the image dimensions Note that the actual size of the rendered image will depend on the width of the columns it spans- Specified by:
setWidthin interfacejxl.biff.drawing.DrawingGroupObject- Overrides:
setWidthin classjxl.biff.drawing.Drawing- Parameters:
c- the number of columns which this image spans
-
getHeight
public double getHeight()Accessor for the image dimensions -
setHeight
public void setHeight(double c) Accessor for the image dimensions Note that the actual size of the rendered image will depend on the height of the rows it spans- Specified by:
setHeightin interfacejxl.biff.drawing.DrawingGroupObject- Overrides:
setHeightin classjxl.biff.drawing.Drawing- Parameters:
c- the number of rows which this image should span
-
getImageFile
Accessor for the image file- Specified by:
getImageFilein interfaceImage- Overrides:
getImageFilein classjxl.biff.drawing.Drawing- Returns:
- the file which the image references
-
getImageData
public byte[] getImageData()Accessor for the image data- Specified by:
getImageDatain interfacejxl.biff.drawing.DrawingGroupObject- Specified by:
getImageDatain interfaceImage- Overrides:
getImageDatain classjxl.biff.drawing.Drawing- Returns:
- the image data
-
setImageAnchor
public void setImageAnchor(jxl.biff.drawing.Drawing.ImageAnchorProperties iap) Accessor for the anchor properties -
getImageAnchor
public jxl.biff.drawing.Drawing.ImageAnchorProperties getImageAnchor()Accessor for the anchor properties
-