com.spire.doc.fields
Class DocPicture

java.lang.Object
  extended by com.spire.doc.OwnerHolder
      extended by com.spire.doc.documents.xml.DocumentSerializable
          extended by com.spire.doc.DocumentObject
              extended by com.spire.doc.DocumentBase
                  extended by com.spire.doc.fields.ParagraphBase
                      extended by com.spire.doc.fields.shapes.ShapeBase
                          extended by com.spire.doc.fields.shapes.Shape
                              extended by com.spire.doc.fields.ShapeObject
                                  extended by com.spire.doc.fields.DocPicture
All Implemented Interfaces:
IDocumentObject, IDocumentSerializable, IParagraphBase, IPicture

public class DocPicture
extends ShapeObject
implements IPicture


Constructor Summary
DocPicture(IDocument doc)
          Initializes a new instance of the class.
 
Method Summary
 IParagraph addCaption(java.lang.String name, CaptionNumberingFormat format, CaptionPosition captionPosition)
          Add Caption for current Picture
 boolean getBiLevel()
          Determines whether an image will be displayed in black and white.
 float getBrightness()
          Gets or sets picture brightness.
 CharacterFormat getCharacterFormat()
          Gets shape object's character format.
 PictureColor getColor()
          Gets or sets picture color.
 float getContrast()
          Get/set picture contrast.
 DocumentObjectType getDocumentObjectType()
           Gets the type of the document object.
 boolean getGrayScale()
          Determines whether a picture will display in grayscale mode.
 float getHeight()
          Returns or sets picture height.
 float getHeightScale()
          Deprecated. 
 ShapeHorizontalAlignment getHorizontalAlignment()
          Returns or setspicture horizontal alignment.
 HorizontalOrigin getHorizontalOrigin()
          Gets or sets horizontal origin of the picture.
 float getHorizontalPosition()
          Gets or sets absolute horizontal position of the picture.
 java.awt.image.BufferedImage getImage()
          Gets internal System.Drawing.Image object.
 byte[] getImageBytes()
          Gets image byte array.
 boolean getLayoutInCell()
          Gets or sets the boolean value that represents whether a picture in a table is displayed inside or outside the table.
 float getRotationEx()
          Gets/Sets the rotation of DocPicture.Specifies the rotation of the graphic frame.
 TextWrappingStyle getTextWrappingStyle()
          Gets or sets text wrapping style of the picture.
 TextWrappingType getTextWrappingType()
          Gets or sets text wrapping type of the picture.
 java.lang.String getTitle()
          Gets the picture title.
 java.awt.Color getTransparentColor()
          Gets or sets transparent color
 ShapeVerticalAlignment getVerticalAlignment()
          Returns or setspicture vertical alignment.
 VerticalOrigin getVerticalOrigin()
          Gets or sets absolute horizontal position of the picture.
 float getVerticalPosition()
          Gets or sets absolute vertical position of the picture.
 float getWidth()
          Returns or sets picture width.
 float getWidthScale()
          Deprecated. 
 boolean isCrop()
          Gets whether the picture object is cropped.
 boolean isUnderText()
          Gets or sets whether picture is below image.
 void isUnderText(boolean value)
          Gets or sets whether picture is below image.
 void loadImage(byte[] imageBytes)
          Loads image as bytes array.
 void loadImage(java.io.InputStream inputStream)
          Loads image.
 void loadImage(java.lang.String imgFile)
          Loads the image.
 void replaceImage(byte[] imageBytes, boolean bIsKeepRation)
          Replaces the image.
 void setBiLevel(boolean value)
          Determines whether an image will be displayed in black and white.
 void setBrightness(float value)
          Gets or sets picture brightness.
 void setColor(PictureColor value)
          Gets or sets picture color.
 void setContrast(float value)
          Get/set picture contrast.
 void setGrayScale(boolean value)
          Determines whether a picture will display in grayscale mode.
 void setHeight(float value)
          Returns or sets picture height.
 void setHeightScale(float value)
          Deprecated. 
 void setHorizontalAlignment(ShapeHorizontalAlignment value)
          Returns or setspicture horizontal alignment.
 void setHorizontalOrigin(HorizontalOrigin value)
          Gets or sets horizontal origin of the picture.
 void setHorizontalPosition(float value)
          Gets or sets absolute horizontal position of the picture.
 void setLayoutInCell(boolean value)
          Gets or sets the boolean value that represents whether a picture in a table is displayed inside or outside the table.
 void setRotationEx(float value)
          Gets/Sets the rotation of DocPicture.Specifies the rotation of the graphic frame.
 void setScale(float scaleFactor)
          Scale the image by scale factor.
 void setScale(float heightFactor, float widthFactor)
          Scale the image by scale factor.
 void setTextWrappingStyle(TextWrappingStyle value)
          Gets or sets text wrapping style of the picture.
 void setTextWrappingType(TextWrappingType value)
          Gets or sets text wrapping type of the picture.
 void setTitle(java.lang.String value)
          Gets the picture title.
 void setTransparentColor(java.awt.Color value)
          Gets or sets transparent color
 void setVerticalAlignment(ShapeVerticalAlignment value)
          Returns or setspicture vertical alignment.
 void setVerticalOrigin(VerticalOrigin value)
          Gets or sets absolute horizontal position of the picture.
 void setVerticalPosition(float value)
          Gets or sets absolute vertical position of the picture.
 void setWidth(float value)
          Returns or sets picture width.
 void setWidthScale(float value)
          Deprecated. 
 
Methods inherited from class com.spire.doc.fields.ShapeObject
getChart, getChildObjects, getExtrusionEnabled, getFillColor, getLineDashing, getLineStyle, getShadowEnabled, getStrokeColor, getStrokeWeight, getWordArt, setFillColor, setFillTransparency, setLineDashing, setLineStyle, setStrokeColor, setStrokeWeight
 
Methods inherited from class com.spire.doc.fields.shapes.Shape
getFirstParagraph, getLastParagraph, hasChart, hasImage
 
Methods inherited from class com.spire.doc.fields.shapes.ShapeBase
adjustWithEffects, getAllowOverlap, getAlternativeText, getAspectRatioLocked, getBehindText, getBottom, getCoordOrigin, getCoordSize, getDistanceBottom, getDistanceLeft, getDistanceRight, getDistanceTop, getFill, getRight, getRotation, getShapeType, getSize, getWrapType, getZOrder, isHidden, isHidden, isSignatureLine, localToParent, setAllowOverlap, setAlternativeText, setAspectRatioLocked, setBehindText, setCoordOrigin, setCoordSize, setDistanceBottom, setDistanceLeft, setDistanceRight, setDistanceTop, setRotation, setShapeType, setWrapType, setZOrder
 
Methods inherited from class com.spire.doc.fields.ParagraphBase
applyCharacterFormat, applyStyle, getDeleteRevision, getInsertRevision, getNextWidgetSibling, getOwnerParagraph, getPreviousWidgetSibling, getStyleName, isDeleteRevision, isInsertRevision
 
Methods inherited from class com.spire.doc.DocumentObject
deepClone, getFirstChild, getLastChild, getNextSibling, getOwner, getPreviousSibling, isComposite, prependChild, toString
 
Methods inherited from class com.spire.doc.OwnerHolder
getDocument
 
Methods inherited from interface com.spire.doc.interfaces.IPicture
getAlternativeText, setAlternativeText
 
Methods inherited from interface com.spire.doc.interfaces.IParagraphBase
applyStyle, getOwnerParagraph, getStyleName
 
Methods inherited from interface com.spire.doc.interfaces.IDocumentObject
deepClone, getDocument, getNextSibling, getOwner, getPreviousSibling, isComposite
 

Constructor Detail

DocPicture

public DocPicture(IDocument doc)
Initializes a new instance of the class.

Parameters:
doc - The doc.
Method Detail

getRotationEx

public float getRotationEx()
Gets/Sets the rotation of DocPicture.Specifies the rotation of the graphic frame.


setRotationEx

public void setRotationEx(float value)
Gets/Sets the rotation of DocPicture.Specifies the rotation of the graphic frame.


getDocumentObjectType

public DocumentObjectType getDocumentObjectType()
Gets the type of the document object.

Specified by:
getDocumentObjectType in interface IDocumentObject
Overrides:
getDocumentObjectType in class ShapeObject
Returns:
The type of the document object.

getHeight

public float getHeight()
Returns or sets picture height.

Specified by:
getHeight in interface IPicture
Overrides:
getHeight in class ShapeBase
Returns:
The value is measured in points.

setHeight

public void setHeight(float value)
Returns or sets picture height.

Specified by:
setHeight in interface IPicture
Overrides:
setHeight in class ShapeBase
Parameters:
value - The value is measured in points.

getWidth

public float getWidth()
Returns or sets picture width.

Specified by:
getWidth in interface IPicture
Overrides:
getWidth in class ShapeBase
Returns:
The value is measured in points.

setWidth

public void setWidth(float value)
Returns or sets picture width.

Specified by:
setWidth in interface IPicture
Overrides:
setWidth in class ShapeBase
Parameters:
value - The value is measured in points.

getHeightScale

@Deprecated
public float getHeightScale()
Deprecated. 

Description copied from interface: IPicture
Returns picture height scale factor in percent.

Specified by:
getHeightScale in interface IPicture
Returns:
float

setHeightScale

@Deprecated
public void setHeightScale(float value)
Deprecated. 

Description copied from interface: IPicture
Sets picture height scale factor in percent.

Specified by:
setHeightScale in interface IPicture
Parameters:
value - float

getWidthScale

@Deprecated
public float getWidthScale()
Deprecated. 

Description copied from interface: IPicture
Returns picture width scale factor in percent.

Specified by:
getWidthScale in interface IPicture
Returns:
float

setWidthScale

@Deprecated
public void setWidthScale(float value)
Deprecated. 

Description copied from interface: IPicture
Sets picture width scale factor in percent.

Specified by:
setWidthScale in interface IPicture
Parameters:
value - float

setScale

public void setScale(float scaleFactor)
Scale the image by scale factor.

Parameters:
scaleFactor - The scale factor. The default unit is percentage.

setScale

public void setScale(float heightFactor,
                     float widthFactor)
Scale the image by scale factor.

Parameters:
heightFactor - The height scale factor. The default unit is percentage.
widthFactor - The width scale factor. The default unit is percentage.

getImage

public java.awt.image.BufferedImage getImage()
Gets internal System.Drawing.Image object.

Specified by:
getImage in interface IPicture
Returns:
BufferedImage

getImageBytes

public byte[] getImageBytes()
Gets image byte array.

Specified by:
getImageBytes in interface IPicture
Returns:
byte[]

getGrayScale

public boolean getGrayScale()
Determines whether a picture will display in grayscale mode.

The default value is false.


setGrayScale

public void setGrayScale(boolean value)
Determines whether a picture will display in grayscale mode.

The default value is false.


getBiLevel

public boolean getBiLevel()
Determines whether an image will be displayed in black and white.

The default value is false.


setBiLevel

public void setBiLevel(boolean value)
Determines whether an image will be displayed in black and white.

The default value is false.


getBrightness

public float getBrightness()
Gets or sets picture brightness.


setBrightness

public void setBrightness(float value)
Gets or sets picture brightness.


getContrast

public float getContrast()
Get/set picture contrast.


setContrast

public void setContrast(float value)
Get/set picture contrast.


getColor

public PictureColor getColor()
Gets or sets picture color.


setColor

public void setColor(PictureColor value)
Gets or sets picture color.


getTransparentColor

public java.awt.Color getTransparentColor()
Gets or sets transparent color


setTransparentColor

public void setTransparentColor(java.awt.Color value)
Gets or sets transparent color


isCrop

public boolean isCrop()
Gets whether the picture object is cropped.


getHorizontalOrigin

public HorizontalOrigin getHorizontalOrigin()
Gets or sets horizontal origin of the picture.

Specified by:
getHorizontalOrigin in interface IPicture
Overrides:
getHorizontalOrigin in class ShapeBase
Returns:
HorizontalOrigin

setHorizontalOrigin

public void setHorizontalOrigin(HorizontalOrigin value)
Gets or sets horizontal origin of the picture.

Specified by:
setHorizontalOrigin in interface IPicture
Overrides:
setHorizontalOrigin in class ShapeBase
Parameters:
value - HorizontalOrigin

getVerticalOrigin

public VerticalOrigin getVerticalOrigin()
Gets or sets absolute horizontal position of the picture.

Specified by:
getVerticalOrigin in interface IPicture
Overrides:
getVerticalOrigin in class ShapeBase
Returns:
VerticalOrigin

setVerticalOrigin

public void setVerticalOrigin(VerticalOrigin value)
Gets or sets absolute horizontal position of the picture.

Specified by:
setVerticalOrigin in interface IPicture
Overrides:
setVerticalOrigin in class ShapeBase
Parameters:
value - VerticalOrigin

getHorizontalPosition

public float getHorizontalPosition()
Gets or sets absolute horizontal position of the picture.

The value is measured in points and the position is relative to HorizontalOrigin.

Specified by:
getHorizontalPosition in interface IPicture
Overrides:
getHorizontalPosition in class ShapeBase
Returns:
the value is measured in points and the position is relative to HorizontalOrigin.

setHorizontalPosition

public void setHorizontalPosition(float value)
Gets or sets absolute horizontal position of the picture.

The value is measured in points and the position is relative to HorizontalOrigin.

Specified by:
setHorizontalPosition in interface IPicture
Overrides:
setHorizontalPosition in class ShapeBase
Parameters:
value - the value is measured in points and the position is relative to HorizontalOrigin.

getVerticalPosition

public float getVerticalPosition()
Gets or sets absolute vertical position of the picture.

The value is measured in points and the position is relative to VerticalOrigin.

Specified by:
getVerticalPosition in interface IPicture
Overrides:
getVerticalPosition in class ShapeBase
Returns:
the value is measured in points and the position is relative to VerticalOrigin.

setVerticalPosition

public void setVerticalPosition(float value)
Gets or sets absolute vertical position of the picture.

The value is measured in points and the position is relative to VerticalOrigin.

Specified by:
setVerticalPosition in interface IPicture
Overrides:
setVerticalPosition in class ShapeBase
Parameters:
value - the value is measured in points and the position is relative to VerticalOrigin.

getTextWrappingStyle

public TextWrappingStyle getTextWrappingStyle()
Gets or sets text wrapping style of the picture.

Specified by:
getTextWrappingStyle in interface IPicture
Overrides:
getTextWrappingStyle in class ShapeBase
Returns:
TextWrappingStyle

setTextWrappingStyle

public void setTextWrappingStyle(TextWrappingStyle value)
Gets or sets text wrapping style of the picture.

Specified by:
setTextWrappingStyle in interface IPicture
Overrides:
setTextWrappingStyle in class ShapeBase
Parameters:
value - TextWrappingStyle

getTextWrappingType

public TextWrappingType getTextWrappingType()
Gets or sets text wrapping type of the picture.

Specified by:
getTextWrappingType in interface IPicture
Overrides:
getTextWrappingType in class ShapeBase
Returns:
TextWrappingType

setTextWrappingType

public void setTextWrappingType(TextWrappingType value)
Gets or sets text wrapping type of the picture.

Specified by:
setTextWrappingType in interface IPicture
Overrides:
setTextWrappingType in class ShapeBase
Parameters:
value - TextWrappingType

getHorizontalAlignment

public ShapeHorizontalAlignment getHorizontalAlignment()
Returns or setspicture horizontal alignment.

If it is set as None, then the picture is explicitly positioned using position properties. Otherwise it is positioned according to the alignment specified. The position of the object is relative to HorizontalOrigin.

Specified by:
getHorizontalAlignment in interface IPicture
Overrides:
getHorizontalAlignment in class ShapeBase
Returns:
ShapeHorizontalAlignment

setHorizontalAlignment

public void setHorizontalAlignment(ShapeHorizontalAlignment value)
Returns or setspicture horizontal alignment.

If it is set as None, then the picture is explicitly positioned using position properties. Otherwise it is positioned according to the alignment specified. The position of the object is relative to HorizontalOrigin.

Specified by:
setHorizontalAlignment in interface IPicture
Overrides:
setHorizontalAlignment in class ShapeBase
Parameters:
value - ShapeHorizontalAlignment

getVerticalAlignment

public ShapeVerticalAlignment getVerticalAlignment()
Returns or setspicture vertical alignment.

If it is set as None, then the picture is explicitly positioned using position properties. Otherwise it is positioned according to the alignment specified. The position of the object is relative to VerticalOrigin.

Specified by:
getVerticalAlignment in interface IPicture
Overrides:
getVerticalAlignment in class ShapeBase
Returns:
ShapeVerticalAlignment

setVerticalAlignment

public void setVerticalAlignment(ShapeVerticalAlignment value)
Returns or setspicture vertical alignment.

If it is set as None, then the picture is explicitly positioned using position properties. Otherwise it is positioned according to the alignment specified. The position of the object is relative to VerticalOrigin.

Specified by:
setVerticalAlignment in interface IPicture
Overrides:
setVerticalAlignment in class ShapeBase
Parameters:
value - ShapeVerticalAlignment

isUnderText

public boolean isUnderText()
Gets or sets whether picture is below image.

Specified by:
isUnderText in interface IPicture

isUnderText

public void isUnderText(boolean value)
Gets or sets whether picture is below image.

Specified by:
isUnderText in interface IPicture

getCharacterFormat

public CharacterFormat getCharacterFormat()
Gets shape object's character format.

Overrides:
getCharacterFormat in class ShapeObject
Returns:
The paragraph item character format.

getTitle

public java.lang.String getTitle()
Gets the picture title.

Specified by:
getTitle in interface IPicture
Overrides:
getTitle in class ShapeBase
Returns:
The title.

setTitle

public void setTitle(java.lang.String value)
Gets the picture title.

Specified by:
setTitle in interface IPicture
Overrides:
setTitle in class ShapeBase
Parameters:
value - the title text

getLayoutInCell

public boolean getLayoutInCell()
Gets or sets the boolean value that represents whether a picture in a table is displayed inside or outside the table.


setLayoutInCell

public void setLayoutInCell(boolean value)
Gets or sets the boolean value that represents whether a picture in a table is displayed inside or outside the table.


loadImage

public void loadImage(java.lang.String imgFile)
Loads the image.

Specified by:
loadImage in interface IPicture
Parameters:
imgFile - The img file.

loadImage

public void loadImage(java.io.InputStream inputStream)
Loads image.

Specified by:
loadImage in interface IPicture
Parameters:
inputStream - the image input stream

loadImage

public void loadImage(byte[] imageBytes)
Loads image as bytes array.

Specified by:
loadImage in interface IPicture
Parameters:
imageBytes -

replaceImage

public void replaceImage(byte[] imageBytes,
                         boolean bIsKeepRation)
Replaces the image.

Parameters:
imageBytes - The image bytes.
bIsKeepRation -

addCaption

public IParagraph addCaption(java.lang.String name,
                             CaptionNumberingFormat format,
                             CaptionPosition captionPosition)
Add Caption for current Picture

Specified by:
addCaption in interface IPicture
Parameters:
captionPosition -
name -
format -
Returns: