Problems with usage of function V3d_View::ToPixMap

Hi everybody,

I want to create a bitmap from my current view which must be scalable (I use the bitmap in printing and therefore need to adjust its size to the paper size). I think the function V3d_View::ToPixMap shall do it, but if I dump the resulting pixmap to a *.bmp file the file only shows the background color of my view window. Here's a code snippet:

Handle(Aspect_PixMap) aBitmap = GetView()->m_3dview->ToPixMap (1280, 1024, 0);
aBitmap->Dump("test.bmp");

Perhaps anybody else has experiences with the usage of this function.

Sven.

n-southall's picture

Hi Sven,

I think the problem is that you have set the planes depth to zero. If you just use the default I think it will work for you:

Handle(Aspect_PixMap) aBitmap = GetView()->m_3dview->ToPixMap (1280, 1024);

Neil

Sven Jungnickel's picture

You're right...Thanks for your help.

I was so focused on the bitmap size that I didn't recognize the depth parameter