• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class ImageContent

An image content element returned by the content-stream interpreter. Supports saving the decoded image to a file.

Inheritance
object
ContentElement
ImageContent
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Pdf.Content
Assembly: DRIT.Pdf.dll
Syntax
public sealed class ImageContent : ContentElement

Properties

Bounds

Bounding box of this element in the page's user-space coordinate system (origin at lower-left, y-up, units = points).

Declaration
public override PdfRect Bounds { get; }
Property Value
Type Description
PdfRect
Overrides
ContentElement.Bounds

ElementType

The type of this content element.

Declaration
public override ContentElementType ElementType { get; }
Property Value
Type Description
ContentElementType
Overrides
ContentElement.ElementType

Image

Image metadata (pixel size).

Declaration
public ImageData Image { get; }
Property Value
Type Description
ImageData

Methods

Save(Stream, ImageSaveFormat, int)

Save the image to a stream in the requested format.

Declaration
public void Save(Stream stream, ImageSaveFormat format = ImageSaveFormat.Png, int jpegQuality = 85)
Parameters
Type Name Description
Stream stream

Writable destination stream.

ImageSaveFormat format

Target image format.

int jpegQuality

JPEG quality in range 1-100.

Save(string)

Save the image to a file. The output format is inferred from extension: .jpg / .jpeg => JPEG, .tif / .tiff => TIFF, otherwise PNG.

Declaration
public void Save(string path)
Parameters
Type Name Description
string path
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX