function ChooseRenderFlags(Scale: Double; DestWidth, DestHeight: Integer): Integer;
| Scale | Double. Final scale factor of the render, where values below 1.0 mean the page is being reduced |
| DestWidth, DestHeight | Integer. Size of the destination bitmap in pixels |
| Result | Integer. Bitwise combination of FPDF_RENDER_* flags, or 0 when the defaults are appropriate |
Two situations call for non-default flags, and both depend on numbers a caller only knows at render time. Below a scale of 0.5, FPDF_RENDER_FORCEHALFTONE gives better image quality than the default interpolation, because source pixels far outnumber destination pixels. Above roughly four megapixels of destination bitmap, FPDF_RENDER_LIMITEDIMAGECACHE keeps a page full of large images from exhausting memory
The result is meant to be combined with whatever the application already sets, so a zoom-out view and a poster-sized export each get the flags that fit without hard-coding one flag set for every zoom level
Flags are returned as an integer for the native render entry points; the higher-level RenderPage overloads take a TRenderOptions set instead