I have a problem with the screen capture in vtk 5-03. <br><br>This code copies the image of the main render window to the clipboard.<br>The problem is that after its execution, you cannot see any actor in the screen (something like opacity 0. to all actors)
<br><br>This worked fine for years (up to the 5-01 version). <br>Has anybody any information about how to resolve this?(or maybe it is a bug)<br><br>Thank you in advance!<br><br> int *size = this->renWin->GetSize();
<br> this->renWin->SetupMemoryRendering(size[0], size[1], GetDC()->GetSafeHdc());<br> this->renWin->Render();<br><br> unsigned char *data = this->ren->GetVTKWindow()->GetPixelData(0, 0, size[0]-1, size[1]-1, 1);
<br><br> CDC *pDC = GetDC();<br> CBitmap bitmap;<br> bitmap.CreateCompatibleBitmap(pDC, size[0], size[1]);<br><br> unsigned long *bits = new unsigned long[size[0] * size[1]];<br> int i, j, k;
<br> for (j=0; j<size[1]; j++) {<br> for (i=0; i<size[0]; i++) {<br> k = 3 * ((size[1] - j - 1) * size[0] + i);<br> bits[j*size[0]+i] = RGB(data[k+2], data[k+1], data[k]);
<br> }<br> }<br> bitmap.SetBitmapBits(size[0] * size[1] * 4, (void *)bits);<br> delete []bits;<br> delete []data;<br><br> EmptyClipboard();<br> SetClipboardData(CF_BITMAP, bitmap);
<br> CloseClipboard();<br> bitmap.DeleteObject();<br> ReleaseDC(pDC);<br> this->renWin->ResumeScreenRendering();<br> this->renWin->Render();