Hello Jerome,
Here is one answer for Win32
I know nothing about Test harness and I could'nt make it work with previous reply but it helped me to find the new function "SetBackgroundImage" and try it.
With OCC 5.1 (installed on D:\ here) it works perfectly well
I just modified the MFC Sample 07 3d Viewer just below . You must change the filename to fit your needs of course.
To make it work YOU MUST first compile mfcsample project and put the lib in some correct library. I've modified the setting of project mfcsample.dsw to output directly files to :
D:\OpenCASCADE5.1\ros\win32\libd\mfcsample.lib
/////////////////////////////////////////////////////////////////////////////
// CViewer3dView drawing
void CViewer3dView::OnInitialUpdate()
{
CView::OnInitialUpdate();
myView = GetDocument()->GetViewer()->CreateView();
// set the default mode in wireframe ( not hidden line ! )
myView->SetDegenerateModeOn();
// store for restore state after rotation (witch is in Degenerated mode)
myDegenerateModeIsOn = Standard_True;
Handle(Graphic3d_WNTGraphicDevice) theGraphicDevice =
((CViewer3dApp*)AfxGetApp())->GetGraphicDevice();
Handle(WNT_Window) aWNTWindow = new WNT_Window(theGraphicDevice,GetSafeHwnd ());
myView->SetWindow(aWNTWindow);
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
// Standard_Integer w=100 , h=100 ; /* Debug Matrox */
// aWNTWindow->Size (w,h) ; /* Keeps me unsatisfied (rlb)..... */
/* Resize is not supposed to be done on */
/* Matrox */
/* I suspect another problem elsewhere */
// ::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
// store the mode ( nothing , dynamic zooming, dynamic ... )
myCurrentMode = CurAction3d_Nothing;
Standard_CString FileName("D:\\OpenCASCADE5.1\\ros\\src\\Textures\\MyScreenTexture.gif");
Aspect_FillMethod FillStyle(Aspect_FM_NONE);//Aspect_FM_STRETCH
Standard_Boolean update(Standard_True);
myView->SetBackgroundImage(FileName, FillStyle, update) ;
}