Home » Community » Newbie corner » Example: TextToSvgPath - Draw + Paint (Unified Draw-Paint Call - cannot call 'Color')
Example: TextToSvgPath - Draw + Paint [message #59141] |
Wed, 09 November 2022 13:44  |
UltimatePP
Messages: 3 Registered: November 2022
|
Junior Member |
|
|
Hi folks, absolute newbie here.
I'm picking apart the example projects while combing through the documentation, this is the best way for me to learn, but I've exhausted all options and feel calling on the forum is my best bet.
Within the example project TextToSvgPath's "main.cpp", line 6 and 7 call the colour for the background and text, respectively. I've gone through every module under both Draw and Paint to see if I could find, at the very least, the colours described. I eventually found them listed in two (I think) places last night, one being "Draw.h" where they are listed. They are mentioned in the documentation for Draw as well, but I can't seem to find the referenced RGB values to adjust them. Painter lists colour values in "SvgUtil.cpp" along with RGB values, but the colour is not being fetched from there so I cannot make additions or adjustments to that list for use.
In this instance where Draw/Paint is used, how would I call a specific RGB value as opposed to S/Black or S/Blue, for example? What would the syntax be? I've tried calling Color, but it seems that Color itself is not used to establish RGB for Draw/Paint in the fashion I assumed it would (not a call operator).
Thanks in advance for any response, I'll definitely keep tinkering in the meantime.
|
|
|
Re: Example: TextToSvgPath - Draw + Paint [message #59143 is a reply to message #59141] |
Wed, 09 November 2022 14:38   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
UltimatePP wrote on Wed, 09 November 2022 13:44Hi folks, absolute newbie here.
I'm picking apart the example projects while combing through the documentation, this is the best way for me to learn, but I've exhausted all options and feel calling on the forum is my best bet.
Within the example project TextToSvgPath's "main.cpp", line 6 and 7 call the colour for the background and text, respectively. I've gone through every module under both Draw and Paint to see if I could find, at the very least, the colours described. I eventually found them listed in two (I think) places last night, one being "Draw.h" where they are listed. They are mentioned in the documentation for Draw as well, but I can't seem to find the referenced RGB values to adjust them. Painter lists colour values in "SvgUtil.cpp" along with RGB values, but the colour is not being fetched from there so I cannot make additions or adjustments to that list for use.
In this instance where Draw/Paint is used, how would I call a specific RGB value as opposed to S/Black or S/Blue, for example? What would the syntax be? I've tried calling Color, but it seems that Color itself is not used to establish RGB for Draw/Paint in the fashion I assumed it would (not a call operator).
Thanks in advance for any response, I'll definitely keep tinkering in the meantime.
Have you tried Color(r, g, b) ? (E.g. Color(100, 20, 20)).
|
|
|
Re: Example: TextToSvgPath - Draw + Paint [message #59145 is a reply to message #59143] |
Wed, 09 November 2022 15:16   |
UltimatePP
Messages: 3 Registered: November 2022
|
Junior Member |
|
|
Thank you for the prompt reply, I'm very grateful for your time.
I have given that a shot, that is how Color is documented and I assumed it would work but I only get a return saying that Color is a private constructor and it does not provide a call operator. Here is a snippet of the original code:
void Preview::Paint(Draw& w)
{
DrawPainter sw(w, GetSize());
sw.Clear(SWhite());
sw.Path(svgpath).Fill(SBlack());
}
I've tracked down SWhite and SBlack in "Draw.h" included with the project, but their RGB values are obviously not declared here. The same colours (and Draw.h) are referenced in "SColors.cpp" within Chameleon, but their RGB values are not declared here either, just the dark theme adjustments.
Is there anything I can call that would substitute raw RBG values in "sw.Clear" and "sw.Path(svgpath).Fill"?
Again, thank you for your time!
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:53:06 CEST 2025
Total time taken to generate the page: 0.01020 seconds
|