Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
  • Page:
  • 1
  • 2

TOPIC:

Change Annotation Color 5 years 9 months ago #13972

  • mfranc28
  • mfranc28's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
How can I change Annotation color in Xamarin?
I find Annotation.SetFillColor but want an integer....
If I check current color like this:
int foo = annot.FillColor;

it returns -1, and the box around sign box is filled with blue color
My goal is to erase the square around sign box on pdf if my variable is true or false, some kind of flatten annotation

Please Log in or Create an account to join the conversation.

Last edit: by mfranc28.

Change Annotation Color 5 years 9 months ago #13975

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
the colors must be formatted in that way 0xAARRGGBB as written here : www.radaeepdf.com/documentation/javadocs...ml#SetFillColor-int-

Please Log in or Create an account to join the conversation.

Change Annotation Color 5 years 9 months ago #13978

  • mfranc28
  • mfranc28's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Ok I see but the method want an int input.....

For example if I want to colorize with #80FFFFFF how can I do?

Please Log in or Create an account to join the conversation.

Change Annotation Color 5 years 9 months ago #13979

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
try with 0x80FFFFFF

Please Log in or Create an account to join the conversation.

Change Annotation Color 5 years 9 months ago #13980

  • mfranc28
  • mfranc28's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Try with this

uint n = 0x00FFFFFF;
int color = unchecked((int)n);
annot.SetFillColor(color);

But nothing happen to annotation, try also changing with other color

Please Log in or Create an account to join the conversation.

Last edit: by mfranc28.

Change Annotation Color 5 years 9 months ago #13983

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
To read the fill color:
uint fillColor = (uint) annot.FillColor;
To set it:
annot.SetFillColor(Convert.ToInt32("0x80FFFFFF", 16));
Remember to rerender the page after setting the color.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum