[vtkusers] "SetPixelFormat failed" problem in vtkWin32OpenGLRenderWindow class SetupMemoryRendering() function

Pengfei Liu lpf at vico-lab.com
Sun Jan 23 12:22:15 EST 2011


Hi

I have some problem with the SetupMemoryRendering() method in class
vtkWin32OpenGLRenderWindow.

I create a C++/CLI Form application and want to display images with double
buffering mode.
So I called SetupMemoryRendering() method in a vtkWin32OpenGLRenderWindow
class object
And transfer a bitmap parameter instead of current window control handle.

But always app pop up a message box "SetPixelFormat failed"

Here is code:
----------------------------------------------------------------------------
-

// no related with Format32bppRgb, the problem happens when set other value.
Bitmap Bitmap(nWidth, nHeight, PixelFormat::Format32bppRgb);

m_hBitmap = (HBITMAP)Bitmap.GetHbitmap().ToInt32();

this->m_prenWin->SetupMemoryRendering(this->m_hBitmap);
----------------------------------------------------------------------------
-

This problem happens in my 2 PCs. It has no relationship with OS and display
cards.
The code is run in main thread. So No need considering multi-thread problem.

My VTK version is vtk5.6.

Can anybody give me some suggestion?

Best Regards
Pengfei Liu 





More information about the vtkusers mailing list