ImageDevice

Inheritance: java.lang.Object, com.aspose.page.Device, com.aspose.xps.rendering.DeviceXps

All Implemented Interfaces: com.aspose.page.IMultiPartitionDevice

public final class ImageDevice extends DeviceXps implements IMultiPartitionDevice

Class incapsulating image composing device.

Constructors

ConstructorDescription
ImageDevice()Creates the new instance.
ImageDevice(Dimension pageSize)Creates the new instance with specified media size.

Fields

FieldDescription
DEFAULT_SIZE
VERSIONCurrent device version.

Methods

MethodDescription
closePage()Accomplishes the page.
closePartition()Accomplished the document partition.
create()Creates a new instance of the device based on this device instance.
dispose()Disposes this device instance.
draw(Shape path)Draws the specified path.
drawArc(float x, float y, float width, float height, float startAngle, float arcAngle)Draws an arc.
drawImage(BufferedImage image, AffineTransform transform, Color bkg)Draws an image with assigned transform and background.
drawLine(float x1, float y1, float x2, float y2)Draws a line segment.
drawOval(float x, float y, float width, float height)Draws an oval.
drawPolygon(float[] xPoints, float[] yPoints, int nPoints)Draws a polygon.
drawPolygon(int[] xPoints, int[] yPoints, int nPoints)Draws a polygon.
drawPolyline(float[] xPoints, float[] yPoints, int nPoints)Draws a polyline.
drawPolyline(int[] xPoints, int[] yPoints, int nPoints)Draws a polyline.
drawRect(float x, float y, float width, float height)Draws a rectangle.
drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)Draws a round rectangle.
drawString(String str, float x, float y)Draws a string at the specified position.
endDocument()Accomplishes the document.
equals(Object arg0)
fill(Shape path)Fills the specified path.
fillArc(float x, float y, float width, float height, float startAngle, float arcAngle)Fills an arc.
fillOval(float x, float y, float width, float height)Fills an oval.
fillPolygon(float[] xPoints, float[] yPoints, int nPoints)Fills a polygon.
fillPolygon(int[] xPoints, int[] yPoints, int nPoints)Fills a polygon.
fillRect(float x, float y, float width, float height)Fills a rectangle.
fillRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)Draws a round rectangle.
getBackground()Gets the background color.
getCharTM()Gets current characters transform.
getClass()
getCreator()Gets creator of resulting device output.
getCurrentPageNumber()Returns the absolute number of the current page within the document.
getCurrentRelativePageNumber()Returns the relative number of the current page within the current partition.
getFont()Gets the current font.
getOpacity()Gets the opacity.
getOpacityMask()Gets the brush for opacity mask.
getPaint()Gets the brush for filling paths.
getProperties()Gets device properties including metadata.
getProperty(String key)Gets a value of string property.
getPropertyColor(String key)Gets a value of color property.
getPropertyDouble(String key)Gets a value of double property.
getPropertyInt(String key)Gets a value of integer property.
getPropertyMargins(String key)Gets a value of margins property.
getPropertyMatrix(String key)Gets a value of matrix property.
getPropertyRectangle(String key)Gets a value of rectangle property.
getPropertySize(String key)Gets a value of size property.
getResult()Returns the resulting images byte arrays.
getSaveOptions()Returns save options.
getSize()Gets the device media size.
getStroke()Gets the stroke for drawing paths.
getTextRenderingMode()Gets current text rendering mode.
getTextStrokeWidth()Gets current text stroke width.
getTransform()Returns the current transformation matrix.
hashCode()
initClip()Initializes clip of the device.
initPageNumbers()Initializes numbers of pages to output.
isDirectRGB()Indicates whether device uses direct RGB mode, that is RGB.
isMainDocument()
isProperty(String key)Gets a value of boolean property.
notify()
notifyAll()
openPage(float width, float height)Starts a new page with the specified width and height.
openPage(String title)Starts a new page with the specifies title.
openPartition()Starts a new document partition.
renew()Sets the devices to the initial state.
renewForMerge(boolean mainDocument)
reset()Resets the device.
rotate(double theta)Applies a clockwise rotation about the origin to the current transformation matrix.
rotate(double theta, double x, double y)Rotate the current transformation matrix around a point.
scale(double x, double y)Applies the specified scale vector to the current transformation matrix.
setBackground(Color value)Sets the background color.
setCharTM(AffineTransform charTM)Specifies characters transform.
setClip(Shape clipPath)Adds the specified path to the current clip path.
setCreator(String creator)Specifies creator of resulting device output.
setFont(ITrFont value)Sets the current font.
setOpacity(float value)Sets the opacity.
setOpacityMask(Paint value)Gets the brush for opacity mask.
setPaint(Paint value)Sets the brush for filling paths.
setProperties(UserProperties props)Specifies device properties including metadata.
setSaveOptions(SaveOptions value)Initializes save options.
setSize(Dimension value)Sets the device media size.
setStroke(Stroke value)Sets the stroke for drawing paths.
setTextRenderingMode(TextRenderingMode textRenderingMode)Specifies text rendering mode.
setTextStrokeWidth(float textStrokeWidth)Specifies text stroke width.
setTransform(AffineTransform transform)Sets the current transformation matrix.
shear(double shx, double shy)Applies the specified shear vector to the current transformation matrix.
startDocument()Starts the document.
toString()Returns the name of device type.
transform(AffineTransform transform)Multiplies the current transformation matrix by the specified Matrix .
translate(double x, double y)Applies the specified translation vector to the current transformation matrix.
updatePageParameters(IMultiPageDevice device)Updates the current page parameters.
wait()
wait(long arg0)
wait(long arg0, int arg1)
writeComment(String comment)Writes a comment.
writeString(ITrFont font, String str)Writes out string with specified font.

ImageDevice()

public ImageDevice()

Creates the new instance.

ImageDevice(Dimension pageSize)

public ImageDevice(Dimension pageSize)

Creates the new instance with specified media size.

Parameters:

ParameterTypeDescription
pageSizejava.awt.DimensionThe size of the device output media.

DEFAULT_SIZE

public static final Dimension DEFAULT_SIZE

VERSION

public static String VERSION

Current device version.

closePage()

public void closePage()

Accomplishes the page.

closePartition()

public void closePartition()

Accomplished the document partition.

create()

public Device create()

Creates a new instance of the device based on this device instance. Writes this device graphics state, i.e. creates ApsCanvas instance(s) with corresponding RenderTransform and Clip properties.

Returns: Device - The new device instance.

dispose()

public void dispose()

Disposes this device instance. Finalizes this device instance graphics state, i.e. switches APS composing context to the ApsCanvas of the level higher then this device’s graphics state ApsCanvas .

draw(Shape path)

public void draw(Shape path)

Draws the specified path.

Parameters:

ParameterTypeDescription
pathjava.awt.ShapeThe path to draw.

drawArc(float x, float y, float width, float height, float startAngle, float arcAngle)

public void drawArc(float x, float y, float width, float height, float startAngle, float arcAngle)

Draws an arc.

Parameters:

ParameterTypeDescription
xfloatX coordinate of center of the arc.
yfloatY coordinate of center of the arc.
widthfloatA width of circumscribed rectangle.
heightfloatA height of circumscribed rectangle.
startAnglefloatA start angle of the arc.
arcAnglefloatAn angle of the arc.

drawImage(BufferedImage image, AffineTransform transform, Color bkg)

public void drawImage(BufferedImage image, AffineTransform transform, Color bkg)

Draws an image with assigned transform and background.

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageAn image to be drawn.
transformjava.awt.geom.AffineTransformA transform.
bkgjava.awt.ColorA background color.

drawLine(float x1, float y1, float x2, float y2)

public void drawLine(float x1, float y1, float x2, float y2)

Draws a line segment.

Parameters:

ParameterTypeDescription
x1floatX coordinate of the beginning of segment.
y1floatY coordinate of the beginning of segment.
x2floatX coordinate of the end of segment.
y2floatY coordinate of the end of segment.

drawOval(float x, float y, float width, float height)

public void drawOval(float x, float y, float width, float height)

Draws an oval.

Parameters:

ParameterTypeDescription
xfloatX coordinate of center of the oval.
yfloatY coordinate of center of the oval.
widthfloatA width of circumscribed rectangle.
heightfloatA height of circumscribed rectangle.

drawPolygon(float[] xPoints, float[] yPoints, int nPoints)

public void drawPolygon(float[] xPoints, float[] yPoints, int nPoints)

Draws a polygon.

Parameters:

ParameterTypeDescription
xPointsfloat[]X coordinates of points.
yPointsfloat[]Y coordinate of points.
nPointsintThe number of points.

drawPolygon(int[] xPoints, int[] yPoints, int nPoints)

public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)

Draws a polygon.

Parameters:

ParameterTypeDescription
xPointsint[]X coordinates of points.
yPointsint[]Y coordinate of points.
nPointsintThe number of points.

drawPolyline(float[] xPoints, float[] yPoints, int nPoints)

public void drawPolyline(float[] xPoints, float[] yPoints, int nPoints)

Draws a polyline.

Parameters:

ParameterTypeDescription
xPointsfloat[]X coordinates of points.
yPointsfloat[]Y coordinate of points.
nPointsintThe number of points.

drawPolyline(int[] xPoints, int[] yPoints, int nPoints)

public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)

Draws a polyline.

Parameters:

ParameterTypeDescription
xPointsint[]X coordinates of points.
yPointsint[]Y coordinate of points.
nPointsintThe number of points.

drawRect(float x, float y, float width, float height)

public void drawRect(float x, float y, float width, float height)

Draws a rectangle.

Parameters:

ParameterTypeDescription
xfloatX coordinate of upper left corner of the rectangle.
yfloatY coordinate of upper left corner of the rectangle.
widthfloatA width of the rectangle.
heightfloatA height of the rectangle.

drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

public void drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

Draws a round rectangle.

Parameters:

ParameterTypeDescription
xfloatX coordinate of upper left corner of the rectangle.
yfloatY coordinate of upper left corner of the rectangle.
widthfloatA width of the rectangle.
heightfloatA height of the rectangle.
arcWidthfloatA width of circumscribed rectangle of the arc that rounds an angle of the rectangle.
arcHeightfloatA height of circumscribed rectangle of the arc that rounds an angle of the rectangle.

drawString(String str, float x, float y)

public void drawString(String str, float x, float y)

Draws a string at the specified position.

Parameters:

ParameterTypeDescription
strjava.lang.StringThe text.
xfloatThe x-coordinate of the string position.
yfloatThe y-coordinate of the string position.

endDocument()

public void endDocument()

Accomplishes the document.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

fill(Shape path)

public void fill(Shape path)

Fills the specified path.

Parameters:

ParameterTypeDescription
pathjava.awt.ShapeThe path to fill.

fillArc(float x, float y, float width, float height, float startAngle, float arcAngle)

public void fillArc(float x, float y, float width, float height, float startAngle, float arcAngle)

Fills an arc.

Parameters:

ParameterTypeDescription
xfloatX coordinate of center of the arc.
yfloatY coordinate of center of the arc.
widthfloatA width of circumscribed rectangle.
heightfloatA height of circumscribed rectangle.
startAnglefloatA start angle of the arc.
arcAnglefloatAn angle of the arc.

fillOval(float x, float y, float width, float height)

public void fillOval(float x, float y, float width, float height)

Fills an oval.

Parameters:

ParameterTypeDescription
xfloatX coordinate of center of the oval.
yfloatY coordinate of center of the oval.
widthfloatA width of circumscribed rectangle.
heightfloatA height of circumscribed rectangle.

fillPolygon(float[] xPoints, float[] yPoints, int nPoints)

public void fillPolygon(float[] xPoints, float[] yPoints, int nPoints)

Fills a polygon.

Parameters:

ParameterTypeDescription
xPointsfloat[]X coordinates of points.
yPointsfloat[]Y coordinate of points.
nPointsintThe number of points.

fillPolygon(int[] xPoints, int[] yPoints, int nPoints)

public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)

Fills a polygon.

Parameters:

ParameterTypeDescription
xPointsint[]X coordinates of points.
yPointsint[]Y coordinate of points.
nPointsintThe number of points.

fillRect(float x, float y, float width, float height)

public void fillRect(float x, float y, float width, float height)

Fills a rectangle.

Parameters:

ParameterTypeDescription
xfloatX coordinate of upper left corner of the rectangle.
yfloatY coordinate of upper left corner of the rectangle.
widthfloatA width of the rectangle.
heightfloatA height of the rectangle.

fillRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

public void fillRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

Draws a round rectangle.

Parameters:

ParameterTypeDescription
xfloatX coordinate of upper left corner of the rectangle.
yfloatY coordinate of upper left corner of the rectangle.
widthfloatA width of the rectangle.
heightfloatA height of the rectangle.
arcWidthfloatA width of circumscribed rectangle of the arc that rounds an angle of the rectangle.
arcHeightfloatA height of circumscribed rectangle of the arc that rounds an angle of the rectangle.

getBackground()

public Color getBackground()

Gets the background color.

Returns: java.awt.Color - The background color.

getCharTM()

public AffineTransform getCharTM()

Gets current characters transform.

Returns: java.awt.geom.AffineTransform - Current characters transform.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCreator()

public String getCreator()

Gets creator of resulting device output.

Returns: java.lang.String - A creator value.

getCurrentPageNumber()

public int getCurrentPageNumber()

Returns the absolute number of the current page within the document.

Returns: int - The absolute number of the current page.

getCurrentRelativePageNumber()

public int getCurrentRelativePageNumber()

Returns the relative number of the current page within the current partition.

Returns: int - The relative number of the current page.

getFont()

public ITrFont getFont()

Gets the current font.

Returns: ITrFont - The current font.

getOpacity()

public float getOpacity()

Gets the opacity.

Returns: float - The opacity.

getOpacityMask()

public Paint getOpacityMask()

Gets the brush for opacity mask. The mask applies over Paint or Strike.

Returns: java.awt.Paint - The brush for opacity mask.

getPaint()

public Paint getPaint()

Gets the brush for filling paths.

Returns: java.awt.Paint - The brush for filling paths.

getProperties()

public UserProperties getProperties()

Gets device properties including metadata.

Returns: UserProperties - Device properties.

getProperty(String key)

public String getProperty(String key)

Gets a value of string property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: java.lang.String - The property value.

getPropertyColor(String key)

public Color getPropertyColor(String key)

Gets a value of color property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: java.awt.Color - The property value.

getPropertyDouble(String key)

public double getPropertyDouble(String key)

Gets a value of double property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: double - The property value.

getPropertyInt(String key)

public int getPropertyInt(String key)

Gets a value of integer property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: int - The property value.

getPropertyMargins(String key)

public Insets getPropertyMargins(String key)

Gets a value of margins property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: java.awt.Insets - The property value.

getPropertyMatrix(String key)

public AffineTransform getPropertyMatrix(String key)

Gets a value of matrix property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: java.awt.geom.AffineTransform - The property value.

getPropertyRectangle(String key)

public Rectangle getPropertyRectangle(String key)

Gets a value of rectangle property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: java.awt.Rectangle - The property value.

getPropertySize(String key)

public Dimension getPropertySize(String key)

Gets a value of size property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: java.awt.Dimension - The property value.

getResult()

public byte[][][] getResult()

Returns the resulting images byte arrays. The first dimension is for inner documents and the second one is for pages within inner documents.

Returns: byte[][][] - The resulting images byte arrays.

getSaveOptions()

public SaveOptions getSaveOptions()

Returns save options.

Returns: SaveOptions - The save options.

getSize()

public Dimension getSize()

Gets the device media size.

Returns: java.awt.Dimension - The device media size.

getStroke()

public Stroke getStroke()

Gets the stroke for drawing paths.

Returns: java.awt.Stroke - The stroke for drawing paths.

getTextRenderingMode()

public TextRenderingMode getTextRenderingMode()

Gets current text rendering mode.

Returns: TextRenderingMode - Current text rendering mode.

getTextStrokeWidth()

public float getTextStrokeWidth()

Gets current text stroke width.

Returns: float - Current text stroke width.

getTransform()

public AffineTransform getTransform()

Returns the current transformation matrix.

Returns: java.awt.geom.AffineTransform - The current transformation matrix.

hashCode()

public native int hashCode()

Returns: int

initClip()

public void initClip()

Initializes clip of the device.

initPageNumbers()

public void initPageNumbers()

Initializes numbers of pages to output.

isDirectRGB()

public boolean isDirectRGB()

Indicates whether device uses direct RGB mode, that is RGB.

Returns: boolean - True if direct RGB mode and false otherwise, that is BGR.

isMainDocument()

public boolean isMainDocument()

Returns: boolean

isProperty(String key)

public boolean isProperty(String key)

Gets a value of boolean property.

Parameters:

ParameterTypeDescription
keyjava.lang.StringThe name of property.

Returns: boolean - The property value.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

openPage(float width, float height)

public boolean openPage(float width, float height)

Starts a new page with the specified width and height.

Parameters:

ParameterTypeDescription
widthfloatThe width of the page.
heightfloatThe height of the page.

Returns: boolean - True if started page is to be output (it’s number is contained in PageNumbers save options). False , otherwise.

openPage(String title)

public boolean openPage(String title)

Starts a new page with the specifies title.

Parameters:

ParameterTypeDescription
titlejava.lang.StringThe title.

Returns: boolean - True if started page is to be output (it’s number is contained in PageNumbers save options). False , otherwise.

openPartition()

public void openPartition()

Starts a new document partition.

renew()

public void renew()

Sets the devices to the initial state.

renewForMerge(boolean mainDocument)

public void renewForMerge(boolean mainDocument)

Parameters:

ParameterTypeDescription
mainDocumentboolean

reset()

public void reset()

Resets the device.

rotate(double theta)

public void rotate(double theta)

Applies a clockwise rotation about the origin to the current transformation matrix.

Parameters:

ParameterTypeDescription
thetadoubleThe angle of the rotation, in radians.

rotate(double theta, double x, double y)

public void rotate(double theta, double x, double y)

Rotate the current transformation matrix around a point.

Parameters:

ParameterTypeDescription
thetadoubleAn angle of rotation in radians.
xdoubleX coordinate of point.
ydoubleY coordinate of point.

scale(double x, double y)

public void scale(double x, double y)

Applies the specified scale vector to the current transformation matrix.

Parameters:

ParameterTypeDescription
xdoubleThe x scale factor.
ydoubleThe y scale factor.

setBackground(Color value)

public void setBackground(Color value)

Sets the background color.

Parameters:

ParameterTypeDescription
valuejava.awt.ColorThe background color.

setCharTM(AffineTransform charTM)

public void setCharTM(AffineTransform charTM)

Specifies characters transform.

Parameters:

ParameterTypeDescription
charTMjava.awt.geom.AffineTransform\u0421haracters transform.

setClip(Shape clipPath)

public void setClip(Shape clipPath)

Adds the specified path to the current clip path.

Parameters:

ParameterTypeDescription
clipPathjava.awt.ShapeThe clip path to be added.

setCreator(String creator)

public void setCreator(String creator)

Specifies creator of resulting device output.

Parameters:

ParameterTypeDescription
creatorjava.lang.StringA creator value.

setFont(ITrFont value)

public void setFont(ITrFont value)

Sets the current font.

Parameters:

ParameterTypeDescription
valueITrFontThe current font.

setOpacity(float value)

public void setOpacity(float value)

Sets the opacity.

Parameters:

ParameterTypeDescription
valuefloatThe opacity.

setOpacityMask(Paint value)

public void setOpacityMask(Paint value)

Gets the brush for opacity mask. The mask applies over Paint or Strike.

Parameters:

ParameterTypeDescription
valuejava.awt.PaintThe brush for opacity mask.

setPaint(Paint value)

public void setPaint(Paint value)

Sets the brush for filling paths.

Parameters:

ParameterTypeDescription
valuejava.awt.PaintThe brush for filling paths.

setProperties(UserProperties props)

public void setProperties(UserProperties props)

Specifies device properties including metadata.

Parameters:

ParameterTypeDescription
propsUserPropertiesDevice properties.

setSaveOptions(SaveOptions value)

public void setSaveOptions(SaveOptions value)

Initializes save options.

Parameters:

ParameterTypeDescription
valueSaveOptionsSave options.

setSize(Dimension value)

public void setSize(Dimension value)

Sets the device media size.

Parameters:

ParameterTypeDescription
valuejava.awt.DimensionThe device media size.

setStroke(Stroke value)

public void setStroke(Stroke value)

Sets the stroke for drawing paths.

Parameters:

ParameterTypeDescription
valuejava.awt.StrokeThe stroke for drawing paths.

setTextRenderingMode(TextRenderingMode textRenderingMode)

public void setTextRenderingMode(TextRenderingMode textRenderingMode)

Specifies text rendering mode.

Parameters:

ParameterTypeDescription
textRenderingModeTextRenderingModeText rendering mode.

setTextStrokeWidth(float textStrokeWidth)

public void setTextStrokeWidth(float textStrokeWidth)

Specifies text stroke width.

Parameters:

ParameterTypeDescription
textStrokeWidthfloatText stroke width.

setTransform(AffineTransform transform)

public void setTransform(AffineTransform transform)

Sets the current transformation matrix.

Parameters:

ParameterTypeDescription
transformjava.awt.geom.AffineTransformThe new transformation matrix.

shear(double shx, double shy)

public void shear(double shx, double shy)

Applies the specified shear vector to the current transformation matrix.

Parameters:

ParameterTypeDescription
shxdoubleThe x shear factor.
shydoubleThe y shear factor.

startDocument()

public void startDocument()

Starts the document.

toString()

public String toString()

Returns the name of device type.

Returns: java.lang.String - Type name.

transform(AffineTransform transform)

public void transform(AffineTransform transform)

Multiplies the current transformation matrix by the specified Matrix .

Parameters:

ParameterTypeDescription
transformjava.awt.geom.AffineTransformThe matrix by which the current transformation matrix is to be multiplied.

translate(double x, double y)

public void translate(double x, double y)

Applies the specified translation vector to the current transformation matrix.

Parameters:

ParameterTypeDescription
xdoubleThe x offset.
ydoubleThe y offset.

updatePageParameters(IMultiPageDevice device)

public void updatePageParameters(IMultiPageDevice device)

Updates the current page parameters.

Parameters:

ParameterTypeDescription
deviceIMultiPageDeviceThe multipage device.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int

writeComment(String comment)

public void writeComment(String comment)

Writes a comment.

Parameters:

ParameterTypeDescription
commentjava.lang.StringA comment to be written.

writeString(ITrFont font, String str)

public void writeString(ITrFont font, String str)

Writes out string with specified font.

Parameters:

ParameterTypeDescription
fontITrFontSpecified font.
strjava.lang.StringThe string.