No subject


Wed Oct 7 22:37:18 EDT 2009


becomes just black or white, and there is no way to "change" it, as far as I
understand.

Regards,

Frederic Perez

On Thu, Jan 14, 2010 at 4:24 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> 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<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
>
> 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
> _______________________________________________
> 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
>

--001485f44e76b7854c047d22baa0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello again,<br><br>I&#39;ve browsed the code, and found this definition of=
 GetShadowColor:<br><br><div style=3D"margin-left: 40px;"><span style=3D"fo=
nt-family: courier new,monospace;">void vtkTextProperty::GetShadowColor(dou=
ble color[3])</span><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">{</span><br style=3D"fo=
nt-family: courier new,monospace;"><span style=3D"font-family: courier new,=
monospace;">#if 1</span><br style=3D"font-family: courier new,monospace;"><=
span style=3D"font-family: courier new,monospace;">=A0 double average =3D (=
this-&gt;Color[0] + this-&gt;Color[1] + this-&gt;Color[2]) / 3.0;</span><br=
 style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">#else</span><br style=
=3D"font-family: courier new,monospace;"><span style=3D"font-family: courie=
r new,monospace;">=A0 double average =3D (0.30 * this-&gt;Color[0] + </span=
><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0.59 * this-&gt;Color[1] + </span><br =
style=3D"font-family: courier new,monospace;"><span style=3D"font-family: c=
ourier new,monospace;">=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 0.11 * this-&gt;Color[2]);</span><br style=3D"font-family: courier n=
ew,monospace;">

<span style=3D"font-family: courier new,monospace;">#endif</span><br style=
=3D"font-family: courier new,monospace;"><span style=3D"font-family: courie=
r new,monospace;">=A0 <b>double shadow_i =3D average &gt; 0.5 ? 0.0 : 1.0;<=
/b></span><b><br style=3D"font-family: courier new,monospace;">

<span style=3D"font-family: courier new,monospace;">=A0 color[0] =3D color[=
1] =3D color[2] =3D shadow_i; </span></b><br style=3D"font-family: courier =
new,monospace;"><span style=3D"font-family: courier new,monospace;">}</span=
><br></div>

<br>From this code looks like we can infer that the &quot;shadow color&quot=
; is computed from the &quot;text color&quot; (ie. from the <span style=3D"=
font-family: courier new,monospace;">vtkProperty::Color[] </span>attribute)=
, that it becomes just black or white, and there is no way to &quot;change&=
quot; it, as far as I understand.<br>

<br>Regards,<br><br>Frederic Perez<br><br><div class=3D"gmail_quote">On Thu=
, Jan 14, 2010 at 4:24 PM, David Doria <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:daviddoria%2Bvtk at gmail.com">daviddoria+vtk at gmail.com</a>&gt;</span> wro=
te:<br>

<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><=
div class=3D"h5">On Thu, Jan 14, 2010 at 10:06 AM, Frederic Perez &lt;<a hr=
ef=3D"mailto:fredericpcx at gmail.com">fredericpcx at gmail.com</a>&gt; wrote:<br=
>


&gt; Hello David,<br>
&gt;<br>
&gt; probably the key is to retrieve the properties of the text associated =
with<br>
&gt; the slider and modify it (with ShadowOff).<br>
&gt;<br>
&gt; I found this code of mine---perhaps it might help, I&#39;m not sure:<b=
r>
&gt;<br>
&gt; =A0=A0=A0 void<br>
&gt; =A0=A0=A0 SetSomeTextProperties(<br>
&gt; =A0=A0=A0 =A0=A0=A0 vtkTextProperty* a_pTextProperty,<br>
&gt; =A0=A0=A0 =A0=A0=A0 size_t a_nTextSize,<br>
&gt; =A0=A0=A0 =A0=A0=A0 double a_d3TextColor[3])<br>
&gt; =A0=A0=A0 {<br>
&gt; =A0=A0=A0 =A0=A0=A0 if (!a_pTextProperty)<br>
&gt; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 return;<br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;SetFontFamilyToArial();<br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;BoldOff();<br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;ItalicOff();<br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;ShadowOff();<br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;SetFontSize(a_nTextSize);<br>
&gt; =A0=A0=A0 =A0=A0=A0 // &#39;- Fails to work (?).<br>
&gt; =A0=A0=A0 =A0=A0=A0 //=A0=A0=A0 See <a href=3D"http://markmail.org/mes=
sage/xyx2y7cdwuj3aw55" target=3D"_blank">http://markmail.org/message/xyx2y7=
cdwuj3aw55</a><br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;SetColor(a_d3TextColor);<br>
&gt; =A0=A0=A0 =A0=A0=A0 a_pTextProperty-&gt;SetJustificationToCentered();<=
br>
&gt; =A0=A0=A0 =A0=A0=A0 //a_pTextProperty-&gt;SetVerticalJustificationToCe=
ntered();<br>
&gt; =A0=A0=A0 }<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Frederic Perez<br>
&gt;<br>
&gt; On Thu, Jan 14, 2010 at 3:57 PM, David Doria &lt;<a href=3D"mailto:dav=
iddoria%2Bvtk at gmail.com">daviddoria+vtk at gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; To change the font color of a slider, I found to do this:<br>
&gt;&gt; sliderRep-&gt;GetTitleProperty()-&gt;SetColor(1,0,0);//red<br>
&gt;&gt;<br>
&gt;&gt; However, as this example demonstrates:<br>
&gt;&gt; <a href=3D"http://www.cmake.org/Wiki/VTK/Examples/Widgets/Cxx/Slid=
er2D" target=3D"_blank">http://www.cmake.org/Wiki/VTK/Examples/Widgets/Cxx/=
Slider2D</a><br>
&gt;&gt;<br>
&gt;&gt; there is a white outline around the red text:<br>
&gt;&gt; <a href=3D"http://www.rpi.edu/%7Edoriad/VTK_List/slider.jpg" targe=
t=3D"_blank">http://www.rpi.edu/~doriad/VTK_List/slider.jpg</a><br>
&gt;&gt;<br>
&gt;&gt; Anyone know how to remove the outline and simply make the text red=
?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt; David<br>
<br>
</div></div>Ah, that did the trick, thanks Frederic.<br>
<br>
However, in vtkTextProperty, I see GetShadowColor(), but no<br>
SetShadowColor(). Is there a way to change the shadow color to a color<br>
that makes sense rather than simply turn it off?<br>
<div><div></div><div class=3D"h5"><br>
Thanks,<br>
<br>
David<br>
_______________________________________________<br>
Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.kitware=
.com</a><br>
<br>
Visit other Kitware open-source projects at <a href=3D"http://www.kitware.c=
om/opensource/opensource.html" target=3D"_blank">http://www.kitware.com/ope=
nsource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href=3D"http://w=
ww.vtk.org/Wiki/VTK_FAQ" target=3D"_blank">http://www.vtk.org/Wiki/VTK_FAQ<=
/a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"http://www.vtk.org/mailman/listinfo/vtkusers" target=3D"_blank">=
http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>

--001485f44e76b7854c047d22baa0--


More information about the vtkusers mailing list