Text Box Opacity
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.
Text Box Opacity
Hello,
• What is the way to set Opacity for a Text Box field?
I tried to get the Text Box IPXC_Annotation widget and then set Opacity value on Annotation Data, but it does not work.
• Is there a way to make a Text Box' text transparent? Annotation Data has FColor and SColor properties of IColor type, but the interface does not have any opacity settings.
Any code snippets in C# will be appreciated.
Thank you
• What is the way to set Opacity for a Text Box field?
I tried to get the Text Box IPXC_Annotation widget and then set Opacity value on Annotation Data, but it does not work.
• Is there a way to make a Text Box' text transparent? Annotation Data has FColor and SColor properties of IColor type, but the interface does not have any opacity settings.
Any code snippets in C# will be appreciated.
Thank you
Re: Text Box Opacity
There is another option to add text using IPXC_ContentCreator which allows to set opacity, but there is something strange with color displayed.
SetFillColorRGB accepts parameter of uint type.
The following is standard conversion from html color to uint:
Color color = System.Drawing.ColorTranslator.FromHtml("#FF0000");
uint uintColor = (uint)((color.A << 24) | (color.R << 16) |
(color.G << | (color.B << 0));
So CC.SetFillColorRGB(uintColor), where CC is IPXC_ContentCreator instance, should produce red fill color, but it the color is blue.
Any ideas?
SetFillColorRGB accepts parameter of uint type.
The following is standard conversion from html color to uint:
Color color = System.Drawing.ColorTranslator.FromHtml("#FF0000");
uint uintColor = (uint)((color.A << 24) | (color.R << 16) |
(color.G << | (color.B << 0));
So CC.SetFillColorRGB(uintColor), where CC is IPXC_ContentCreator instance, should produce red fill color, but it the color is blue.
Any ideas?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text Box Opacity
Hello AlexD,
Check out the CoreAPIDemo project - it holds many samples:
https://github.com/tracker-software/PDF ... oreAPIDemo
Cheers,
Alex
Check out the CoreAPIDemo project - it holds many samples:
https://github.com/tracker-software/PDF ... oreAPIDemo
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Text Box Opacity
The CoreApi project does not work with the following code modification
Convert from html color to uint:
Color color = System.Drawing.ColorTranslator.FromHtml("#FF0000");
Get uint color value:
uint uintColor = (uint)((color.A << 24) | (color.R << 16) |
(color.G << 8) | (color.B << 0));
CC.SetFillColorRGB(uintColor), where CC is IPXC_ContentCreator instance, should produce red fill color, but it the color is blue.
Convert from html color to uint:
Color color = System.Drawing.ColorTranslator.FromHtml("#FF0000");
Get uint color value:
uint uintColor = (uint)((color.A << 24) | (color.R << 16) |
(color.G << 8) | (color.B << 0));
CC.SetFillColorRGB(uintColor), where CC is IPXC_ContentCreator instance, should produce red fill color, but it the color is blue.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text Box Opacity
Hello AlexD,
That's because the construction of color looks like this:
Cheers,
Alex
That's because the construction of color looks like this:
Code: Select all
#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Re: Text Box Opacity
...so it is ignoring 'Alpha'. Thanks
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Text Box Opacity
Hello AlexD,
Not only that - you have specified color components in reverse. You can use the SetFillAlpha method to specify the Alpha value if needed.
Cheers,
Alex
Not only that - you have specified color components in reverse. You can use the SetFillAlpha method to specify the Alpha value if needed.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Text Box Opacity
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ