[vtkusers] Remove white outline on slider text
David Doria
daviddoria+vtk at gmail.com
Thu Jan 14 10:24:42 EST 2010
On Thu, Jan 14, 2010 at 10:06 AM, Frederic Perez <fredericpcx at gmail.com> wrote:
> Hello David,
>
> probably the key is to retrieve the properties of the text associated with
> the slider and modify it (with ShadowOff).
>
> I found this code of mine---perhaps it might help, I'm not sure:
>
> void
> SetSomeTextProperties(
> vtkTextProperty* a_pTextProperty,
> size_t a_nTextSize,
> double a_d3TextColor[3])
> {
> if (!a_pTextProperty)
> return;
> a_pTextProperty->SetFontFamilyToArial();
> a_pTextProperty->BoldOff();
> a_pTextProperty->ItalicOff();
> a_pTextProperty->ShadowOff();
> a_pTextProperty->SetFontSize(a_nTextSize);
> // '- Fails to work (?).
> // See http://markmail.org/message/xyx2y7cdwuj3aw55
> a_pTextProperty->SetColor(a_d3TextColor);
> a_pTextProperty->SetJustificationToCentered();
> //a_pTextProperty->SetVerticalJustificationToCentered();
> }
>
> Regards,
>
> Frederic Perez
>
> On Thu, Jan 14, 2010 at 3:57 PM, David Doria <daviddoria+vtk at gmail.com>
> wrote:
>>
>> To change the font color of a slider, I found to do this:
>> sliderRep->GetTitleProperty()->SetColor(1,0,0);//red
>>
>> However, as this example demonstrates:
>> http://www.cmake.org/Wiki/VTK/Examples/Widgets/Cxx/Slider2D
>>
>> there is a white outline around the red text:
>> http://www.rpi.edu/~doriad/VTK_List/slider.jpg
>>
>> Anyone know how to remove the outline and simply make the text red?
>>
>> Thanks,
>>
>> David
Ah, that did the trick, thanks Frederic.
However, in vtkTextProperty, I see GetShadowColor(), but no
SetShadowColor(). Is there a way to change the shadow color to a color
that makes sense rather than simply turn it off?
Thanks,
David
More information about the vtkusers
mailing list