Print preview problem with large components

General TRichView support forum. Please post your questions here
Post Reply
Posts: 6
Joined: Thu Jun 01, 2006 1:16 pm

Print preview problem with large components

Post by Martijn » Thu Jun 01, 2006 2:00 pm


We've run into a problem with TRVPrint and TRVPrintPreview. We've been using the OnPrintComponent event to draw components manually. However, once components get exceedingly big (say 5000x5000, or 3000x500) the OnPrintComponent function isn't called and printing fails.

The print preview keeps spawning an endless amount of 'low resource' dialogs (which are windows dialogs), while the TRVPrint spawns a single 'low resource' dialog. Once the error occurs with print preview your only option is a forced end task of the application.

After a quick analysis, it appears that the problem lies within the
TCustomPrintableRVData.DrawPage function. It allocates a temporary
bitmap, which uses up all available resources.

We've also checked if inserting normal bitmaps of this size would cause problems and discovered that this is also the case.

We know that allocating such a large bitmap is going to be intensive for the system. However, the component should handle the problem better. We'd really like some sort of fix for this. Initially being able to handle the error would suffice, but we also need an actual solution.

Hope to hear from you soon,

Unilogic BV

Post Reply