[vtkusers] About Memory Rendering
Liu Jiquan
liujq at vico-lab.dyndns.org
Tue Jul 16 03:04:13 EDT 2002
Hi, VTK users,
I want to draw something directly to "vtkWindow", for example, I want to draw a border around the "vtkWindow". So I code as following:
==========================================================
CRect oRect;
GetClientRect(oRect);
this->SetupMemoryRendering( oRect.Width(),
oRect.Height(),
pDC->m_hAttribDC);
vtkMFCRenderView::OnDraw(pDC);
vtkWin32OpenGLRenderWindow *pRenderWindow = (vtkWin32OpenGLRenderWindow*)this->GetVTKWindow();
CDC *pMemoryDC = CDC::FromHandle( pRenderWindow->GetMemoryDC() );
CPen *pOldPen = NULL;
CPen oFramePen( PS_SOLID, 1, FOCUS_COLOR_3D );
pOldPen = pMemoryDC->SelectObject(&oFramePen);
pMemoryDC->SelectStockObject(NULL_BRUSH);
pMemoryDC->Rectangle(oRect);
pMemoryDC->SelectObject(pOldPen);
pDC->SetStretchBltMode(HALFTONE);
pDC->StretchBlt( 0, 0, oRect.Width(), oRect.Height(),
CDC::FromHandle( pRenderWindow->GetMemoryDC() ),
0, 0, oRect.Width(), oRect.Height(), SRCCOPY );
this->ResumeScreenRendering();
============================================================
The rendering result is no problem, but the rendering speed is decreased very much.
Is there any other method to draw something into "vtkWindow" directly without using vtk actors?
Regards,
Denver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020716/e4690ac7/attachment.htm>
More information about the vtkusers
mailing list