Click or drag to resize
Pdftools logo

ImageSamples Property

The raw content of the image.

The samples (pixels) are given in order, top to bottom, left to right. Each sample is given component by component. There is no padding between components or samples, except that each row of sample data begins on a byte boundary. If the number of data bits per row is not a multiple of 8, the end of the row is padded with extra bits to fill out the last byte. Padding bits should be ignored.

Most often, each component is 8 bits, so there's no packing/unpacking or alignment/padding. Components with 2 or 4 bits are very rare.

If the image is compressed, it will be decompressed in order to get the samples. For very large images, this may take some time.

When setting samples, the original compression type of the image does not change. Compression from the raw samples typically takes significantly longer than decompression. Therefore, setting for large images might be perceived as slow. None of the image parameters can be changed, so when setting samples, the size of the array must match that of the original image.


Namespace: PdfTools.Toolbox.Pdf.Content
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.4.0+02318d3e3f9645a1305b87026fb971a660079e54
Syntax
C#
public byte[] Samples { get; set; }

Property Value

Byte
Exceptions
ExceptionCondition
InvalidOperationExceptionif the image has already been closed
ArgumentNullException[set] if value is .
See Also