You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
885 B
45 lines
885 B
#
|
|
# display text over an image
|
|
#
|
|
|
|
package require vtk
|
|
package require vtkinteraction
|
|
package require vtktesting
|
|
|
|
vtkImageEllipsoidSource ellipse
|
|
|
|
vtkImageMapper mapImage
|
|
mapImage SetInputConnection [ellipse GetOutputPort]
|
|
mapImage SetColorWindow 255
|
|
mapImage SetColorLevel 127.5
|
|
|
|
vtkActor2D img
|
|
img SetMapper mapImage
|
|
|
|
vtkTextMapper mapText
|
|
mapText SetInput "Text Overlay"
|
|
[mapText GetTextProperty] SetFontSize 15
|
|
[mapText GetTextProperty] SetColor 0 1 1
|
|
[mapText GetTextProperty] BoldOn
|
|
[mapText GetTextProperty] ShadowOn
|
|
|
|
vtkActor2D txt
|
|
txt SetMapper mapText
|
|
txt SetPosition 138 128
|
|
|
|
vtkRenderer ren1
|
|
ren1 AddActor2D img
|
|
ren1 AddActor2D txt
|
|
|
|
vtkRenderWindow renWin
|
|
renWin AddRenderer ren1
|
|
|
|
vtkRenderWindowInteractor iren
|
|
iren SetRenderWindow renWin
|
|
|
|
iren AddObserver UserEvent {wm deiconify .vtkInteract}
|
|
|
|
renWin Render
|
|
iren Initialize
|
|
|
|
wm withdraw .
|
|
|