For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Problem of drawing text on Visual3d_Layer.

DY's picture

I use DrawText() on Visual3D_Layer.
When a state of a window to be minimize and restore, rectangles and polylines are correctly displaying but nevertheless the text is hidden.

My code;

// Get over layer
// aView is Handle(V3d_View).
Handle(Visual3d_Layer) myLayer = aView->View()->OverLayer();
if (myLayer.IsNull()) {
myLayer = new Visual3d_Layer(aView->View()->ViewManager(), Aspect_TOL_OVERLAY, Standard_True);

// Init layout
myLayer->SetViewport(width, height); // Window size
myLayer->SetOrtho(0, width, height, 0, (Aspect_TypeOfConstraint)-1);

myLayer->SetTextAttributes("Courier", Aspect_TODT_NORMAL, Quantity_Color(Quantity_NOC_WHITE));
myLayer->DrawText((Standard_CString)"Thanks OpenCASCADE Technorogy!", 100, 100, 18);


My environment is Microsoft Windows 7 (32bit) with OCCT version 6.7.1.
The video card is NVIDIA NVS 3100M.

I tryed in the another mathicnes with the same executable binary,

Windows XP 32bit / NVIDIA NVS3100M: OK
Windows 7 32bit / Intel Graphics(on board): OK
Windows 7 64 bit / Intel Graphics(on board): OK
Windows XP 32bit / Intel Graphics(on board): Crash with raising memory allocation exception at Visual3D_Layer::DrawText().

How can I fix my code for displaying text?