Out of memory exception when using TPrintPreview

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Out of memory exception when using TPrintPreview

Postby kra » June 22nd, 2004, 3:29 pm

Hello All,

First of all, thank you to the author and all contributors!
I have searched around a lot and TPrintPreview seems to be what
I have looked around!

Unfortunately when loading bigger graphics (two times 500x6500 pixels)
into the preview I get an 'out of memory' exception
(Triggered by the closing of the metafile)

I have already set UseTempFile to true(as I understand this is necessary with many pages, or in my case with few(one) page with very big bitmaps in it)

Any suggestions what I can do?

Christian
kra
Member
Member
 
Posts: 2
Joined: June 22nd, 2004, 3:21 pm
Location: austria

Postby Kambiz » June 22nd, 2004, 8:14 pm

I modified the demo program (Genaral) by loading a 2000x6500x24bit bitmap (37MB) in to Image2 (an invisible control), which its content appears on the second page of the preview. As you can guess, there was no out of memory exception. My machine has XP with 512MB memory.

I guess your OS is either Windows 98 or NT 4.

I suggest to downsample the images.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby kra » June 23rd, 2004, 7:28 am

Hello,

Thank you for the lightspeed response!
Now I have some good hints where to search.

Yes, my laptop still runs W98. Unfortunately customers use W98/NT4/W2K
/XP so I would like to support all that platforms.

Do I understand it correctly that there is a problem with the maximal size
of memory streams for the metafile? Would it be possible to use a disk based file instead?

The application has to do with marking of boxes. There are big (background) bitmaps containing mostly whitespace, but some drawing
objects like barcodes, logos etc. For reason of WYSIWYG downsampling would be suboptimal, as thin lines and fine parts of the logos might
disappear.

Best regards,

Christian
kra
Member
Member
 
Posts: 2
Joined: June 22nd, 2004, 3:21 pm
Location: austria

Postby Kambiz » June 23rd, 2004, 9:14 am

Hi,

The problem is not in Metafile. Windows cannot manage huge bitmaps.

You should divide the original bitmap to some smaller ones, and then tile the background with them.

Cheers,
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest