[vtkusers] Remove white outline on slider text

Frederic Perez fredericpcx at gmail.com
Thu Jan 14 10:06:53 EST 2010


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<daviddoria%2Bvtk 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<http://www.rpi.edu/%7Edoriad/VTK_List/slider.jpg>
>
> Anyone know how to remove the outline and simply make the text red?
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100114/8cba8cf8/attachment.htm>


More information about the vtkusers mailing list