[vtkusers] faint png image

Alexander Pletzer pletzer at txcorp.com
Sat Aug 9 17:20:34 EDT 2014


Hello VTK'ians,

I'm trying to display a png logo in the renderer. The result, for some 
reason, is very faint. I tried to set the layer number but had no 
effect. Also tried to change the size with SetWidth but that had no 
effect either (??)

What am I doing wrong? Thanks in advance for any suggestion!

--Alex

import vtk

reader = vtk.vtkPNGReader()
mapper = vtk.vtkImageMapper()
actor = vtk.vtkActor2D()

reader.SetFileName('solarfs.png')

mapper.SetInputConnection(reader.GetOutputPort())
actor.SetMapper(mapper)

ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
iren = vtk.vtkRenderWindowInteractor()

renWin.AddRenderer(ren)
iren.SetRenderWindow(renWin)
ren.SetBackground(1,1,1)
renWin.SetSize(640, 640)
actor.SetPosition2(50, 50)
actor.SetWidth(0.1) # no effect
ren.AddActor(actor) # very faint picture

iren.Initialize()
renWin.Render()
iren.Start()







-------------- next part --------------
A non-text attachment was scrubbed...
Name: solarfs.png
Type: image/png
Size: 19489 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140809/3e73f310/attachment.png>


More information about the vtkusers mailing list