Black pages in TPrintPreview

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

Black pages in TPrintPreview

Postby andrews812 » March 7th, 2007, 3:00 pm

Hello!
I found weird problem with TPP in my application.

I use PaintGraphicEx method to draw a bitmap from TImage object.
It's often (9 of 10 times) when i draw about 10+ pages i got pages filled in black in printable area instead a bitmap which i draw.
I absolutely can't understand what happening and can't provide more information. It's hard for me to debug TPP's internal functions :cry:

I tried to save my bitmaps to file with TBitmap::SaveToFile() method
and opened it with picture viewer, and they displayed ok, so i can say that source bitmaps which i specify to PaintGraphicEx are "correct".
I'll be so happy if somebody can help me. Thank you!

I use C++ Builder 6 Enterprise + TPrintPreview v4.71
andrews812
Member
Member
 
Posts: 4
Joined: March 7th, 2007, 2:32 pm
Location: Russia

Postby Kambiz » March 9th, 2007, 8:03 pm

Could you please post here your code for page creation?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby andrews812 » March 12th, 2007, 3:43 pm

my code is complicated and relatively big, so i attached my CreatePages() method to this post.

some words to simplify understanding of what i draw:
1. text header with TCanvas::TextOut() method
2. VirtualStringTree (very useful component from http://www.soft-gems.net/VirtualTreeview) with tree header on each page
3. standard TChart component

unfortunatelly i can't emitate such situation with simple test application...
Attachments
create_pages.cpp
(6.47 KiB) Downloaded 156 times
andrews812
Member
Member
 
Posts: 4
Joined: March 7th, 2007, 2:32 pm
Location: Russia

Postby Kambiz » March 13th, 2007, 12:19 pm

For creat the temporary bitmaps please use TBitmap object instead of TImage.

Hope that it fixes the problem.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby andrews812 » March 14th, 2007, 10:17 am

Unfortunatelly not :(
andrews812
Member
Member
 
Posts: 4
Joined: March 7th, 2007, 2:32 pm
Location: Russia

Postby Kambiz » March 14th, 2007, 8:52 pm

Your sample code seems to be okay. I don't know what could be wrong, sorry. :(
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby andrews812 » April 3rd, 2007, 3:13 pm

it seems i localized the problem..
When i point object type of TImage or TBitmap to PaintGraphicEx, it rendered in black pages. When i point object type of TMetafile it rendered ok.

It's happening exactly in my application which contains lot of controls, components,forms, WinXP themes support etc... In my simple test application i have no such problem. I can't explain this situation... :?

But, by rendering a TMetafile with PaintGraphicEx i got weird image distortion. Image doesn't fit all page area and looks like compressed (zoomed out with all flags set to false and zoomed in with Proportional set to true, distorted). It's another weird thing (exactly with TMetafile) :)
andrews812
Member
Member
 
Posts: 4
Joined: March 7th, 2007, 2:32 pm
Location: Russia


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest