Xojo Conferences

DynaPDF Manual - Page 265

Previous Page 264   Index   Next Page 266

Function Reference
Page 265 of 770
However, the scaline length can be longer than necessary, e.g. due to aligment requirements of
certain image formats like Windows Bitmaps. A negative value of the scanline length mirrors the
image vertically.
The pointer of a PDF instance is required because the rasterizer uses the error log of the PDF instance
to output warnings and errors.
The return value of the function is a pointer to the rasterizer object. This pointer is required in
functions like RenderPage().
The rasterizer uses the error log of the PDF instance to output warnings and error messages but it
does never raise PDF exceptions. So, an error that occurs during rendering does not affect the PDF
file in memory.
Return values:
When the function succeeds the return value is the pointer of the rasterizer object. If the function fails
the return value is NULL.
CreateRasterizerEx (Rendering Engine)
IRAS* rasCreateRasterizerEx(
const PPDF* IPDF,
// Instance pointer
const void* DC,
// Device Context (HDC)
UI32 Width,
// Width in Pixel
UI32 Height,
// Height in Pixel
TPDFPixFormat PixFmt) // Wished pixel format
The function creates a new instance of a rasterizer. The caller is responsible to release the rasterizer
when finish with DeleteRasterizer().
The difference in comparison to CreateRasterizer() is that this version creates a DIB Section in the
specified size and pixel format that is compatible to a device context. A DIB Section is required to
render into a device context with RenderPageEx(). The image buffer is released when the rasterizer is
The function supports the pixel formats pxf1Bit, pxfGray, pxfBGR, and pxfBGRA. The pixel format
pxfBGRA should only be used when the page is rendered over an arbitrary background image. The
default pixel format on Windows is pxfBGR.
The pixel format is directly connected with the rasterizer and cannot be changed at runtime. When
the pixel format must be changed then delete the rasterizer and create a new one in that pixel format.
The size of the image buffer can be changed at runtime with ResizeBitmap().

Previous topic: CreateRasterizer (Rendering Engine)

Next topic: CreateResetAction, CreateSeparationCS