<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I wrote simple code as following to decide how much memory a vtkTexture would result. <br>without using texture (by commenting out the line "actor-&gt;SetTexture(pTexture)" ), the process takes 74MB memory, <br>using texture(by uncommenting the line "actor-&gt;SetTexture(pTexture)" ), the process takes 105MB memory.<br>the dimension of picture FOREST011.jpg is 11083 X 823, and takes 1,015KB<br><br>Can somebody give me any idea what's going on, or how to avoid this memory expense?<br><br>thanks a lot<br>Tracy<br><br>int main_vtk(int argc, char* argv[])<br>{<br>&nbsp;&nbsp;&nbsp; vtkJPEGReader* pJPEGReader = vtkJPEGReader::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pJPEGReader-&gt;SetFileName("D:\\FOREST011.jpg");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pJPEGReader-&gt;ReleaseDataFlagOn();<br>&nbsp;&nbsp;&nbsp; vtkTexture* pTexture =
 vtkTexture::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTexture-&gt;SetInputConnection(pJPEGReader-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTexture-&gt;InterpolateOn();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pTexture-&gt;ReleaseDataFlagOn();<br>&nbsp;&nbsp;&nbsp; pJPEGReader-&gt;Delete();<br><br>&nbsp;&nbsp;&nbsp; vtkSphereSource *sphere = vtkSphereSource::New();<br>&nbsp;&nbsp;&nbsp; vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapper-&gt;SetInputConnection(sphere-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapper-&gt;ScalarVisibilityOff();<br>&nbsp;&nbsp;&nbsp; vtkActor *actor = vtkActor::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actor-&gt;SetMapper(mapper);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actor-&gt;GetProperty()-&gt;SetColor(0.0, 0.0, 1.0);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actor-&gt;SetTexture(pTexture);<br>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; vtkRenderer* ren = vtkRenderer::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ren-&gt;SetBackground(1, 1, 1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ren-&gt;AddActor(actor);<br><br>&nbsp;&nbsp;&nbsp; vtkRenderWindow* renWin = vtkRenderWindow::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; renWin-&gt;AddRenderer(ren);<br><br>&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; iren-&gt;SetRenderWindow(renWin);<br>&nbsp;&nbsp;&nbsp; vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; iren-&gt;SetInteractorStyle(style);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; renWin-&gt;SetSize(600,600);<br>&nbsp;&nbsp;&nbsp; renWin-&gt;SetPosition(600, 100);<br>&nbsp;&nbsp;&nbsp; renWin-&gt;Render();<br><br>&nbsp;&nbsp;&nbsp; iren-&gt;Initialize();<br>&nbsp;&nbsp;&nbsp;
 iren-&gt;Start();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return 0;<br>}<br><br></td></tr></table><br>