DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Out of memory exception when using TPrintPreview

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
kra
Member


Joined: 22 Jun 2004
Posts: 2
Location: austria

PostPosted: 22/06/04 15:29    Post subject: Out of memory exception when using TPrintPreview Reply with quote

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
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 385
Location: Tehran, Iran

PostPosted: 22/06/04 20:14    Post subject: Reply with quote

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.
Back to top
View user's profile Send e-mail Visit poster's website
kra
Member


Joined: 22 Jun 2004
Posts: 2
Location: austria

PostPosted: 23/06/04 07:28    Post subject: Reply with quote

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
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 385
Location: Tehran, Iran

PostPosted: 23/06/04 09:14    Post subject: Reply with quote

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
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group