I'm using ContentCreator, and ShowTextBlock.
Is it possible to set the background of the textblock color ?
For example, if I create a textblock with the intent of covering existing text, I would want the text to be black, and the background to be white...
Or if want, white text on a black background, etc..
Thanks.
Can a textblock have a color background?
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Can a textblock have a color background?
Hello Wayne,
You should fill the rectangle first and then draw the text on top. The rectangle can be calculated when you output the text itself with DTF_CalcSizeOnly flag.
For more, please refer to the https://github.com/tracker-software/PDF ... oreAPIDemo project.
Look into the 4.3 Text Rendering Mode and 4.7 Patterns sample for more info.
Cheers,
Alex
You should fill the rectangle first and then draw the text on top. The rectangle can be calculated when you output the text itself with DTF_CalcSizeOnly flag.
For more, please refer to the https://github.com/tracker-software/PDF ... oreAPIDemo project.
Look into the 4.3 Text Rendering Mode and 4.7 Patterns sample for more info.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 269
- Joined: Tue Jul 07, 2015 3:30 pm
Re: Can a textblock have a color background?
OK, thanks - I'll dig around.
BTW I've downloaded and run the new Demo - nice!
Only one issue: While running, after I select any sample from the left side, the "Go To Source" button does nothing,
nor does the code show in the window below the button.
(I'm running VS 2017)
BTW I've downloaded and run the new Demo - nice!
Only one issue: While running, after I select any sample from the left side, the "Go To Source" button does nothing,
nor does the code show in the window below the button.
(I'm running VS 2017)
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Can a textblock have a color background?
Hello Wayne,
Please check the NuGet packages for the project - the FCTB package should be installed for the text coloring (just for a test to ensure that they did).
As for the problem, please check the toolStripButton2_Click implementation - and read the exception codes if they occur.
I think you can experience the problem here:
Cheers,
Alex
Please check the NuGet packages for the project - the FCTB package should be installed for the text coloring (just for a test to ensure that they did).
As for the problem, please check the toolStripButton2_Click implementation - and read the exception codes if they occur.
I think you can experience the problem here:
Code: Select all
EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE");
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ