[vtkusers] Drawing individual pixels in vtkRenderWindow

Jingyi Jin jinjingyi at yahoo.com
Sun Sep 23 17:21:20 EDT 2001


Hi,

I was wondering whether it is possible to change
individual pixels of the sceen by calling the method
->SetPixelData(i,i,i,j,pixel,0) from the class
vtkRenderWindow. I tested this method but it didn't
work as I expected, the following is my code fragment:

**********************
unsigned char *pixel = new unsigned char[3];
pixel[0] = 255; pixel[1] = 255; pixel[2] = 255;
  
for (i=0; i<W; i++) {
  for (j=0; j<H; j++) {
    ren2->GetRenderWindow()->SetPixelData(i,j,i,j, 
pixel, 0);
  }
}
**********************

The result that I got after executing it was just a
black screen!

Could anyone give me an idea of what I did wrong in
the above code? If there is another way that I can
try, I would be enlightened to learn about. 

Thank you for your kind attention.

Jingyi

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com



More information about the vtkusers mailing list