|
|
|
|
|
SftPrintPreview.RenderContent Event |
Page drawing event.
Syntax
|
VB.NET |
Private Sub object_RenderContent(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.RenderContent |
||
|
VB |
Private Sub object_RenderContent(ByVal Function As SftPrintPreviewRenderContentConstants, LastPage As Long, VisitedPageInfo As Variant) |
||
|
C#.NET |
void object_RenderContent(object sender, EventArgumentType e); |
||
|
VC++ |
void OnRenderContentobject(enum SftPrintPreviewRenderContentConstants Function, long* LastPage, const _variant_t&* VisitedPageInfo); |
||
|
C |
HRESULT OnRenderContentobject(enum SftPrintPreviewRenderContentConstants Function, long* LastPage, VARIANT* VisitedPageInfo); |
||
|
Delphi |
procedure objectRenderContent(Sender: TObject; Function : TOleEnum; var LastPage : Integer; var VisitedPageInfo : OleVariant); |
object
A SftPrintPreview object.
Function
Describes the function to be performed by the event handler.
|
Name |
Value |
Description |
|
1 |
Initialize - Called each time the preview display is repainted or pages are printed, to initialize print/preview of one or more pages. This call is typically used to initialize and allocate resources that are used to render pages. |
|
|
2 |
One Page - Called to render one page into the output device context RenderingInfo.hDC. |
|
|
3 |
Terminate - Called each time the preview display has completed repainting or pages have been printed, to terminate print/preview of one or more pages. This call is typically used to free resources that were allocated during the preceding renderSftPrintPreview_Init call. |
|
|
4 |
Clear Cache - Called when the entire output needs to be reformatted, because the page and printer attributes have changed, causing all pages to require reformatting. This call is used to free any information saved by the callback routine aiding in page positioning. |
|
|
5 |
Dimensions
- Called before rendering one page (renderSftPrintPreview_1Page) to
determine the desired dimensions of the output. This call is used
to allow the callback to decide how the output is placed on the output
page (see ContentSizing property). |
LastPage
The RenderContent event handler code returns the page number of the last page, once it is known. Otherwise, this value should not be modified. Until a last page is known, new pages will be formatted and displayed as needed. Page numbers are zero-based.
VisitedPageInfo
The RenderContent event handler code returns an application defined value describing the exact output position to resume printing of the next page.
Comments
The RenderContent event occurs informing the application of a page drawing request.
This method is not supported for use with Visual Basic 6.0
When the RenderContent event is called with a Function argument of renderSftPrintPreview_1Page, the application renders the requested page RenderingInfo.CurrentPage. At the end, it can save an application defined value in the VisitedPageInfo argument of the event. This value can be a simple long value, or even an object or a pointer to an application allocated structure. In either case, the value describes the exact output position necessary to resume printing (the next page). SftPrintPreview/OCX saves all these returned values and they are accessible through the VisitedPageInfo property. The VisitedPageInfo property is an array of application-defined values, one entry for each visited page (starting at the first page, page 0). Up to VisitedPages entries are available.