PDFPAGE_SetPixel
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

This method sets a pixel to the given color.

Syntax

HRESULT PDFPAGE_SetPixel (
DOUBLE x,
DOUBLE y,
OLE_COLOR color
)
Parameters
x
X-coordinate of the pixel position

y
Y-coordinate of the pixel position

color
Color of the pixel.

Return value
If successful, this method returns S_OK. If it fails, this method should return one of the error values.

Remarks

Equivalent in new interface: None. Instead use IPDFDocument4::DrawRectangle with width and height set to 1px.

Example

Setpixel example

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
PDF.PDFPAGE_SetPixel(10, 10, 255); { red }
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
PDF->PDFPAGE_SetPixel(10, 10, RGB(0xFF, 0, 0));
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
PDF.PDFPAGE_SetPixel(10, 10, System.Drawing.ColorTranslator.ToWin32(Color.Red));
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
PDF.PDFPAGE_SetPixel 10, 10, 255 'red
PDF.EndDoc

See Also

Reference