Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Shade background |
Post Reply |
Author | |
waynefulcher
Senior Member Joined: 23 Jun 08 Location: United States Status: Offline Points: 99 |
Post Options
Thanks(0)
Posted: 03 Aug 10 at 6:28PM |
I want to draw some text (in black) then fill the background with a light gray color.
Can anyone give me an example of how to do that.
I have tried transparency and setfillcolor and nothing seems to work.
Here is a snippet of my code.
x := LeftMargin ;
PDF.DrawText(x, y, 'Form ID') ; PDF.DrawText(x+wFormID, y, 'Form Description') ; y := y + LineHeight ; PDF.DrawText(x, y, 'Pages') ; PDF.DrawText(x+wFormID, y, 'DCN') ; y := y + (LineHeight div 4) ; PDF.DrawLine(x, y, PDF.PageWidth-RightMargin, y) ; // Here is where I want to shade the background and I have no idea what colors make light gray PDF.SetFillColor(10,10,10) ; PDF.SetTransparency(70) ; PDF.DrawBox(LeftMargin, SaveY, PDF.PageWidth-LeftMargin-RightMargin, y-SaveY, 2) ;
PDF.SetTransparency(0) ; y := y + LineHeight ; |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Wayne!
I've taken some code out of one of my components: //. . . var colr, colg, colb : Double; if ( rgb1 = '' ) then rgb1 := '1,0'; if ( rgb2 = '' ) then rgb2 := '1,0'; if ( rgb3 = '' ) then rgb3 := '1,0'; colr := StrToFloat(rgb1); colg := StrToFloat(rgb2); colb := StrToFloat(rgb3); QP2 := TQuickPDF0717.Create; try QP2.UnlockKey('...'); // . . . QP2.SetFillColor(colr,colg,colb); // . . . QP2.DrawText(...); // . . . Finally QP2.SaveToFile...; QP2.Free; end; //. . . Please keep in mind that we're talking about RGB-colors. The max-value for R, G and B is 1! ...(1.0, 1.0, 1.0) means white ...(0.0, 0.0, 0.0) means black. Make some tests with values below 1.0 ... Cheers, Ingo |
|
waynefulcher
Senior Member Joined: 23 Jun 08 Location: United States Status: Offline Points: 99 |
Post Options
Thanks(0)
|
worked great. I am a bone head I forget what the ranges were for the RGB colors.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store