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!
Navy Blue color is wrong |
Post Reply |
Author | |
fletchsod
Team Player Joined: 11 Sep 20 Status: Offline Points: 40 |
Post Options
Thanks(0)
Posted: 15 Jun 21 at 3:53PM |
When I used this to try making the font color be Navy Blue but it end up as a bright blue. Why?
private readonly Color _argbColorIsNavyBlue = Color.FromArgb(35, 35, 142); |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3527 |
Post Options
Thanks(0)
|
Is this syntax from QuickPDF... i think no? ;-)
The data should make navy blue - dealing with online rgb generators make it. Think there are still some settings before having influence on the color? |
|
Cheers,
Ingo |
|
fletchsod
Team Player Joined: 11 Sep 20 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
var argColorIsNavyBlue = Color.FromArgb(35, 35, 142); // .NET Color
pdfApp.SetTextColor(argColorIsNavyBlue.R, argColorIsNavyBlue.G, argColorIsNavyBlue.B); // Passed on RGB value to Quick PDF's SetTextColor
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
QP.SetTextColor arguments should be Double values between 0 and 1.0. I suspect that Color.R and friends are bytes, but I am not that familiar with C#.
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
QP.SetTextColor(35.0/255.0, 35.0/255.0, 142.0/255.0); // looks like Navy Blue to me! |
|
fletchsod
Team Player Joined: 11 Sep 20 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Okay, another question. How come the color Red works but not different Green color?
QP.SetTextColor(255.0/255.0, 0.0/255.0, 0.0/255.0); // Red QP.SetTextColor(0.0/255.0, 128.0/255.0, 0.0/255.0); // Green
Edited by fletchsod - 18 Jun 21 at 5:14PM |
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
Please clarify what you mean by 'different'. For light green you need to start with white and reduce the red and blue. What you show should be darker green. For selecting colours I always go to an application like Paint.net with a good colour-picker that I can adjust, and which then displays the RGB and HSV values. Does this not paint correctly in QPDF when you divide the values by 255?
|
|
fletchsod
Team Player Joined: 11 Sep 20 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Post the sample code here that works for you when you tested it.
Ignore the comment regarding different green. That remark comment is wrong but my post comment is correct. I updated the post to remove the word "Different". Thanks.
Edited by fletchsod - 18 Jun 21 at 5:16PM |
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
Sorry, I am not a C# user and I cannot test your code. We are all users here.
I just went to the Foxit PDF Library Dashboard, found the Text and HTML / Draw Text sample script, then added one line near the top reading QP.SetTextColor(0.0, 0.5, 0.0); When I ran the modified sample script, it came out green, a bit darker than with 1.0 as the second parameter. These sample scripts are an excellent way to test QP functions quickly. If things work in the scripting, you then just have to change the syntax details to your own programming language.
|
|
fletchsod
Team Player Joined: 11 Sep 20 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
I don't mean C# example. Just the Quick PDF example. Ok, seeing your example, I know what the issue is now. It works now when the 0.0 was used instead of 0 in my case. I think the C++ Quick PDF component internally see things a bit different.
Thanks.
|
|
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