Print Page | Close Window

Navy Blue color is wrong

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3926
Printed Date: 22 Nov 24 at 1:45PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Navy Blue color is wrong
Posted By: fletchsod
Subject: Navy Blue color is wrong
Date 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);




Replies:
Posted By: Ingo
Date Posted: 15 Jun 21 at 7:49PM
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



Posted By: fletchsod
Date Posted: 16 Jun 21 at 2:53PM
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


Posted By: tfrost
Date Posted: 16 Jun 21 at 4:29PM
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#.


Posted By: tfrost
Date Posted: 16 Jun 21 at 4:34PM
QP.SetTextColor(35.0/255.0, 35.0/255.0, 142.0/255.0);  // looks like Navy Blue to me!



Posted By: fletchsod
Date Posted: 16 Jun 21 at 8:03PM
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


Posted By: tfrost
Date Posted: 18 Jun 21 at 5:10PM
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?


Posted By: fletchsod
Date Posted: 18 Jun 21 at 5:14PM
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.


Posted By: tfrost
Date Posted: 18 Jun 21 at 6:44PM
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.


Posted By: fletchsod
Date Posted: 18 Jun 21 at 7:02PM
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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk