Skip to main content
daitranthanhoa
Inspiring
November 5, 2019
Answered

Why can't change fill color if text setting [None] color by SDK?

  • November 5, 2019
  • 1 reply
  • 789 views

I have TextFrame setting color =None

Now, i want change color to swatch name ="TestColor"

But my code can't apply,

 

My code below:

 

 

ICharInspector oCharInspector = textRange.GetCharInspector();
ICharFeatures oCharFeature = textRange.GetUniqueCharFeatures();

AISwatchRef swatchRef = sAISwatchList->GetSwatchByName(NULL, ai::UnicodeString(strColorName.c_str()));
result = sAISwatchList->GetAIColor(swatchRef, &fontColor);


sAIATEPaint->CreateATEApplicationPaint(&fontColor, &fillColRef);
IApplicationPaint oAppPaint(fillColRef);
oCharFeature.SetFillColor(oAppPaint);

//Apply 
textRange.SetLocalCharFeatures(oCharFeature);

 

 

If i change color of Text to other color (Ex: Black), My code working ok.

Why can't change color if Text setting none color?

This topic has been closed for replies.
Correct answer daitranthanhoa

I had can fix this bug by: oCharFeature.SetFill(true);

1 reply

daitranthanhoa
Inspiring
November 5, 2019

I had set oCharFeature.SetFillVisible(true);

But it still can't apply fillcolor.

daitranthanhoa
daitranthanhoaAuthorCorrect answer
Inspiring
November 6, 2019

I had can fix this bug by: oCharFeature.SetFill(true);