Foxit PDF SDK

Public Member Functions | Static Public Member Functions | List of all members
foxit.pdf.graphics.ImageObject Class Reference
Inheritance diagram for foxit.pdf.graphics.ImageObject:

## Public Member Functions
Bitmap | CloneBitmap (GraphicsObjects graphics_objects)
Bitmap | CloneBitmap (PDFPage page, GraphicsObjects graphics_objects)
| Clone the bitmap from current image graphics object. More...
ColorSpaceType | GetColorSpace ()
| Get color space. More...
PDFObject | GetMask ()
| Get the PDF object that represents the mask of current image graphics object. More...
PDFStream | GetStream ()
| Get image stream. More...
bool | IsImageMask ()
| Check if current image object is treated as mask. More...
void | SetBitmap (Bitmap bitmap, Bitmap mask)
| Set a bitmap to current image graphics object. More...
void | SetImage (Image image, int frame_index)
| Set one frame of an image to current image graphics object. More...
Public Member Functions inherited from foxit.pdf.graphics.GraphicsObject
bool | AddClipPath (Path path, FillMode fill_mode)
| Add a path for clipping. More...
bool | AddClipTextObject (TextObject textobject)
| Add text object for clipping. More...
bool | ClearClips ()
| Clear all clips. More...
GraphicsObject | Clone ()
| Clone a new graphics object. More...
GraphicsObject | Clone (GraphicsObjects src_graphicsobjects, GraphicsObjects dest_graphicsobjects)
| Clone a new graphics object. More...
bool | Equal (GraphicsObject other)
| Check if input object is equal to current object. More...
GraphicsObject.BlendMode | GetBlendMode ()
| Get the blend mode for transparent imaging model. More...
Path | GetClipPath (int index)
| Get a path clip by index. More...
int | GetClipPathCount ()
| Get the count of path clip. More...
FillMode | GetClipPathFillMode (int index)
| Get the fill mode of a path clip by index. More...
RectF | GetClipRect ()
| Get clip rectangle. More...
TextObject | GetClipTextObject (int index)
| Get the text object of a text clip by index. More...
int | GetClipTextObjectCount ()
| Get the count of text clip. More...
ColorState | GetColorState ()
| Get color state. More...
uint | GetFillColor ()
| Get the fill color. More...
float | GetFillOpacity ()
| Get the opacity value for painting operations other than stroking. More...
FormXObject | GetFormXObject ()
| Get the form XObject graphics object if current graphics object represents a form XObject object. More...
GraphState | GetGraphState ()
| Get graph state. More...
ImageObject | GetImageObject ()
| Get the image graphics object if current graphics object represents an image object. More...
LayerNodeArray | GetLayers (LayerTree layer_tree)
| Get all the layers which are associated with current graphics object. More...
MarkedContent | GetMarkedContent ()
| Get marked content object. More...
Matrix2D | GetMatrix ()
| Get matrix. More...
PathObject | GetPathObject ()
| Get the path graphics object if current graphics object represents a path object. More...
RectF | GetRect ()
| Get the rectangle of current graphics object. More...
ShadingObject | GetShadingObject ()
| Get the shading graphics object if current graphics object represents a shading object. More...
uint | GetStrokeColor ()
| Get the stroke color. More...
float | GetStrokeOpacity ()
| Get opacity value for stroke painting operations for paths and glyph outlines. More...
TextObject | GetTextObject ()
| Get the text graphics object if current graphics object represents a text object. More...
GraphicsObject.Type | GetType ()
| Get the type of current graphics object. More...
bool | HasTransparency ()
| Check whether current graphics object has transparency or not. More...
void | Release ()
| Release a cloned or newly created PDF graphics object which has not been inserted into any PDF page or other object. More...
bool | RemoveClipPath (int index)
| Remove a path clip by index. More...
bool | RemoveClipTextObject (int index)
| Remove a text clip by index for clipping. More...
void | Rotate (int angle)
| Rotate current graphics object from current state with specified angle degree in clockwise. More...
void | SetBlendMode (GraphicsObject.BlendMode blend_mode)
| Set the blend mode for transparent imaging model. More...
void | SetClipRect (RectF clip_rect)
| Set clip rectangle. More...
void | SetColorState (ColorState color_state)
| Set color state. More...
void | SetFillColor (uint color)
| Set the fill color. More...
void | SetFillOpacity (float opacity)
| Set the opacity value for painting operations other than stroking. More...
void | SetGraphState (GraphState graph_state)
| Set graph state. More...
void | SetMatrix (Matrix2D matrix)
| Set matrix. More...
void | SetStrokeColor (uint color)
| Set the stroke color. More...
void | SetStrokeOpacity (float opacity)
| Set opacity value for stroke painting operations for paths and glyph outlines. More...
bool | Transform (Matrix2D matrix, bool need_transform_clippath)
| Transform current graphics object. More...

## Static Public Member Functions
static ImageObject | Create (PDFDoc document)
| Create a new image graphics object. More...
static ImageObject | CreateFromType3TextObject (PDFPage page, TextObject text_obj)
| Create an image graphics object from a type3 text object. More...

## Additional Inherited Members
Public Types inherited from foxit.pdf.graphics.GraphicsObject
enum | BlendMode { BlendMode.e_BlendNormal = 0, BlendMode.e_BlendMultiply = 1, BlendMode.e_BlendScreen = 2, BlendMode.e_BlendOverlay = 3, BlendMode.e_BlendDarken = 4, BlendMode.e_BlendLighten = 5, BlendMode.e_BlendColorDodge = 6, BlendMode.e_BlendColorBurn = 7, BlendMode.e_BlendHardlight = 8, BlendMode.e_BlendSoftlight = 9, BlendMode.e_BlendDifference = 10, BlendMode.e_BlendExclusion = 11, BlendMode.e_BlendHue = 21, BlendMode.e_BlendSaturation = 22, BlendMode.e_BlendColor = 23, BlendMode.e_BlendLuminosity = 24 }
| Enumeration for render blend mode. More...
enum | Type { Type.e_TypeAll = 0, Type.e_TypeText = 1, Type.e_TypePath = 2, Type.e_TypeImage = 3, Type.e_TypeShading = 4, Type.e_TypeFormXObject = 5, Type.e_TypeInlines = 6, Type.e_TypeEmptyMarkedContent = 7 }
| Enumeration for PDF graphics object type. More...

## Detailed Description

Image graphics object is a kind of PDF graphics object, so class ImageObject is derived from class GraphicsObject . It offers functions to get/set image graphics object's data.
To create a new image graphics object, please use function ImageObject.Create and then use setting functions to set information to the new image graphics object.

See also
  GraphicsObject

## Member Function Documentation

## ◆ CloneBitmap() [1/2]

Bitmap foxit.pdf.graphics.ImageObject.CloneBitmap | ( | GraphicsObjects | graphics_objects | ) |
| inline

Deprecated:
  This function is deprecated. Use function ImageObject.CloneBitmap with two parameters instead.

Currently, the bitmap can be cloned from image graphics object only when the bitmap format is one of following formats:
foxit.common.Bitmap.DIBFormat.e_DIB8bppMask , foxit.common.Bitmap.DIBFormat.e_DIB8bpp , foxit.common.Bitmap.DIBFormat.e_DIBRgb , foxit.common.Bitmap.DIBFormat.e_DIBRgb32 , foxit.common.Bitmap.DIBFormat.e_DIBArgb , foxit.common.Bitmap.DIBFormat.e_DIBCmyk .
If this function return null, that means the DIB format of the bitmap is unsupported.

Parameters

  [in] | graphics_objects | A valid foxit.pdf.GraphicsObjects object. Please ensure that current image graphics object just belongs to this foxit.pdf.GraphicsObjects object (it may be a PDF page).

Returns
  The new cloned bitmap object. If this function return null, that means the DIB format of the bitmap is unsupported.

## ◆ CloneBitmap() [2/2]

Bitmap foxit.pdf.graphics.ImageObject.CloneBitmap | ( | PDFPage | page,
|  | GraphicsObjects | graphics_objects
| ) |  |
| inline

Clone the bitmap from current image graphics object.

Currently, the bitmap can be cloned from image graphics object only when the bitmap format is one of following formats:
foxit.common.Bitmap.DIBFormat.e_DIB8bppMask , foxit.common.Bitmap.DIBFormat.e_DIB8bpp , foxit.common.Bitmap.DIBFormat.e_DIBRgb , foxit.common.Bitmap.DIBFormat.e_DIBRgb32 , foxit.common.Bitmap.DIBFormat.e_DIBArgb , foxit.common.Bitmap.DIBFormat.e_DIBCmyk .
If this function return null, that means the DIB format of the bitmap is unsupported.

Parameters

  [in] | page | A valid PDF page object. Please ensure that current image graphics object just belongs to this page.
  [in] | graphics_objects | A valid foxit.pdf.GraphicsObjects object. Please ensure that current image graphics object just belongs to this foxit.pdf.GraphicsObjects object (it may be a PDF page).

Returns
  The new cloned bitmap object. If this function return null, that means the DIB format of the bitmap is unsupported.

## ◆ Create()

static ImageObject foxit.pdf.graphics.ImageObject.Create | ( | PDFDoc | document | ) |
| inline static

Create a new image graphics object.

The newly created image graphics object does not have any data yet. Then, setting functions can be called to set data to the new image graphics object. If the newly created image graphics object will not inserted to any page or other objects, please remember to call function GraphicsObject.Release to release it when no use.

Parameters

  [in] | document | A valid PDF document object. The new image graphics object should be inserted to one page of this PDF document then.

Returns
  A new image object. If there is any error, this function will return null.

## ◆ CreateFromType3TextObject()

static ImageObject foxit.pdf.graphics.ImageObject.CreateFromType3TextObject | ( | PDFPage | page,
|  | TextObject | text_obj
| ) |  |
| inline static

Create an image graphics object from a type3 text object.

If the newly created image graphics object will not inserted to any page or other objects, please remember to call function GraphicsObject.Release to release it when no use.

Parameters

  [in] | page | A valid PDF page object.
  [in] | text_obj | A valid text object. This text object should be a type3 text object.

Returns
  A new image object. If there is any error, this function will return null.

## ◆ GetColorSpace()

ColorSpaceType foxit.pdf.graphics.ImageObject.GetColorSpace | ( |  | ) |
| inline

Get color space.

Returns
  Color space. Please refer to values starting from foxit.common.ColorSpaceType.e_ColorSpaceDeviceGray and this would be one of these values.

## ◆ GetMask()

PDFObject foxit.pdf.graphics.ImageObject.GetMask | ( |  | ) |
| inline

Get the PDF object that represents the mask of current image graphics object.

The mask can be either a PDF dictionary or a PDF array:

- A PDF dictionary represents an image mask to be applied to this image.

- A PDF array represents a range of colors to be applied to it as a color key mask.

Please refer to Section 4.8.4 "Image Dictionaries" in <PDF Reference 1.7> for more details.

Returns
  A PDF object that represents the mask. If ImageObject.IsImageMask returns true, this function will return null.

## ◆ GetStream()

PDFStream foxit.pdf.graphics.ImageObject.GetStream | ( |  | ) |
| inline

Get image stream.

Returns
  A foxit.pdf.objects.PDFStream that represents the image stream. If there is any error, this function will return null.

## ◆ IsImageMask()

bool foxit.pdf.graphics.ImageObject.IsImageMask | ( |  | ) |
| inline

Check if current image object is treated as mask.

Returns
  true means current object is treated as mask, while false means not.

## ◆ SetBitmap()

void foxit.pdf.graphics.ImageObject.SetBitmap | ( | Bitmap | bitmap,
|  | Bitmap | mask
| ) |  |
| inline

Set a bitmap to current image graphics object.

Parameters

  [in] | bitmap | A valid bitmap object to be set to current image.
  [in] | mask | Mask bitmap. Default value: A bitmap object by default constructor and not set any value, which means no mask is used. If this is valid, its format should be foxit.common.Bitmap.DIBFormat.e_DIB8bppMask . This is useful only when parameter bitmap does not have an alpha channel.

Returns
  None

Note
  When this function succeeds, function GraphicsObjects.GenerateContent should be called. Please refer to function GraphicsObjects.GenerateContent for more details.

## ◆ SetImage()

void foxit.pdf.graphics.ImageObject.SetImage | ( | Image | image,
|  | int | frame_index
| ) |  |
| inline

Set one frame of an image to current image graphics object.

Input image may contain multiple frames, and only one frame of the image can be set to current image graphics object.

Parameters

  [in] | image | A valid image object. This image should contain at least one frame and the image type should not be foxit.common.Image.Type.e_Unknown .
  [in] | frame_index | Frame index used to decide which frame of parameter image is to be set. Valid range: from 0 to (count-1). count is returned by function common.Image.GetFrameCount .

Returns
  None

Note
  When this function succeeds, function GraphicsObjects.GenerateContent should be called. Please refer to function GraphicsObjects.GenerateContent for more details.