WPImage API

The WPImage class defines API properties that operate on images you insert in a document. The properties are listed below in the following categories:

Image source

The following properties set and get the image source and a string to be displayed when the image is not available.
void  setImageSource(String url)
String  getImageSource()
/* If the image can't be loaded, display this string instead. */
void  setAlternate(String)
String  getAlternate()

Image border width

The following properties set and get the width of the border drawn around the image.
void  setBorderWidth(int)	/* Specify 0 for no border. */
int  getBorderWidth()

Image dimensions

The following properties set and get the dimensions of the image. If the width and height are set to 0, the image is displayed full size.
void  setWidth(int)
int  getWidth()
void  setHeight(int)
int  getHeight()

Image spacing and alignment

The following properties get and set the spacing around the image and alignment of the image.
void  setVSpace(int)	/*  Sets the amount of space above and below the image. */
int  getVSpace()	/* Returns the amount of space above and below the image. */
void  setHSpace(int)	/* Sets the amount of space to the left and right of the image. */
int  getHSpace()	/* Returns the amount of space to the left and right of the image. */
/* Align is assigned one of the following values:
 * left:  The image is aligned with the left margin.
 * right:  The image is aligned with the right margin.
 * top:  The image flows with the text, and the text aligns with the top of the image.
 * middle:  The image flows with the text, and the text aligns with middle of the image.
 * bottom:   The image flows with the text, and the text aligns with bottom of the image. */
void  setAlign(String align)	
String  getAlign()
See also
WordProcessor API Index
WordProcessor Object Model
WordProcessor Home Page