Hi,
... one more topic on this subject ...
Many people would like to set an image in the background of their view.
I'm trying to do it.
I found interesting things and now, I manage to do it in a V2d_View. For those that are interested by the code, here it is (I only tested it on Windows) :
In void CYouAppView2D::OnInitialUpdate(){...}, just add :
TCollection_AsciiString BGFile ("c:\\temp\\bg.bmp");
Standard_CString bgimage = (Standard_CString)(BGFile.ToCString());
myV2dView->SetBackground(bgimage, Aspect_FM_TILED);
This code is OK for 2D Views.
Now, I would like to do the same for 3D Views and I get problems ... :
With nearly the same code :
Handle(WNT_Window) aWNTWindow;
aWNTWindow = new WNT_Window(((CBackgroundApp*)AfxGetApp())->GetGraphicDevice(),GetSafeHwnd());
after that, add :
TCollection_AsciiString BGFile ("c:\\temp\\bg.bmp");
Standard_CString bgimage = (Standard_CString)(BGFile.ToCString());
aWNTWindow->SetBackground(bgimage, Aspect_FM_TILED);
When you display the view, it still has its default color, but when you keep on resizing it, you see the image and the default color blinking ...
The image is loaded but the bg color is draw on top of it ...
Are there coders, here, ready to help me ?
Thank you,
mbd