Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Example: TextToSvgPath - Draw + Paint (Unified Draw-Paint Call - cannot call 'Color')
icon5.gif  Example: TextToSvgPath - Draw + Paint [message #59141] Wed, 09 November 2022 13:44 Go to next message
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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
UltimatePP wrote on Wed, 09 November 2022 13:44
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.


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 Go to previous messageGo to next message
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!
icon10.gif  Re: Example: TextToSvgPath - Draw + Paint [message #59146 is a reply to message #59143] Wed, 09 November 2022 15:23 Go to previous message
UltimatePP
Messages: 3
Registered: November 2022
Junior Member
Very quick update;

Calling Color worked! I had my brackets nested wrong, the brackets included in the original code "(SBlack())" threw me off. Embarassed

Thank you so much for taking the time to respond, I can only imagine how busy you must be throughout the day.
Previous Topic: Some Questions
Next Topic: A couple of noob questions
Goto Forum:
  


Current Time: Wed Apr 24 07:12:32 CEST 2024

Total time taken to generate the page: 0.03977 seconds