I use V3d_View::SetBackgroundImage method to implement gradient background in 3D viewer, and found 100% - reproducable bug here.
First, let's slightly modify Viewer3D sample. In the file Viewer3dView.cpp add line
myView->SetBackgroundImage("Background.bmp", Aspect_FM_STRETCH, true);
to the CViewer3dView::OnInitialUpdate() method, it will be the last line in this method.
Then, you need to create file Background.bmp. It can be any picture, I use 1 pixel width, 256 pixel height gradient fill.
How to reproduce bug:
- Launch modified Viewer3D sample, you will see 3D viewer with your picture as background.
- Call File/Close command from menu, viewer will be closed. Without this step bug will not be reproduced.
- Call File/New command.
- Once more call File/New command. The second viewer will be opened over the first one.
- Call File/Close command. The second viewer will be closed, the first one will be shown, but already without background picture!
If you create some shape in remaining viewer, its behaviour will be quite interesting: the background will be changed from white to black and back to the white depending on selection state of the shape in viewer.
I hope this bug will be fixed soon or later, but before I need some workaround.Can anybody suggest it?
Thanks in advance,