Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a TForm 1

Status
Not open for further replies.

umyeah

Programmer
May 25, 2004
6
US


I am using the code found on the above link to print a TForm since the built in print function doesn't work for Delhpi 4, and for the most part it is working well. However, on occasion (on the Thin Client System) the background, like the background of a textbox, is sometimes printing as blue or gray instead of white. I am guessing that it is doing this to conform to the device context settings (???) but don't know the code well enough to change that.



Any suggestions?
 

Nice chunk of code, BTW. :)

The routine is downgrading to 256 colors, if your Win is using a better color deep, probably it is changing some colors.

Or may be your form is not using the system palette.

For a first try, cut out all the code dealing with the palette. Simply copy your form Canvas in a TBitmap and print it.

buho (A).


 
Thank you!

I don't know if the other people I asked even wanted to look through that code. Thank you for taking the time.

That did the trick but I was just curious, why do you think that that extra code was put in there in the first place? I mean so far for me it is working better without it. What were they trying to accomplish? Do you know?
 
Lemme make a guess: the code is heavily focused on solving bugs in what I believe are old video drivers. Plus it smells like 16 bits (Win 3.x) code.

Old code, IMHO. Dunno if it is OWL (TP7/TPW) code ported to Delphi 32 bits or native Delphi 16 bits code (I have no experience with Delphi 16 bits).

buho (A).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top