Unable to display a cImage on front-layer camera
05 Apr 2026 22:47 #1
// LOGO CHAI3D
//
// load image file
bool logo = bitmapLogo->loadFromFile(RESOURCE_PATH("../resources/images/chai3d.bmp"));
if (!logo)
{
#if defined(_MSVC)
logo = bitmapLogo->loadFromFile("../../../bin/resources/images/chai3d.bmp");
#endif
if (!logo)
{
cout << "Error - Image failed to load correctly." << endl;
close();
return (-1);
}
}
cout << "Logo chai3d - Image load correctly." << endl;
// add bitmap to front layer
camera->m_frontLayer->addChild(bitmapLogo);
//
Proposed fix:
void cPanel::set(const double& a_width,
const double& a_height,
const double& a_radiusTopLeft,
const double& a_radiusTopRight,
const double& a_radiusBottomLeft,
const double& a_radiusBottomRight)
{
// check values
if ((m_width == a_width) &&
(m_height == a_height) &&
(m_panelRadiusTopLeft == a_radiusTopLeft) &&
(m_panelRadiusTopRight == a_radiusTopRight) &&
(m_panelRadiusBottomLeft == a_radiusBottomLeft) &&
(m_panelRadiusBottomRight == a_radiusBottomRight))
{
// update model of panel
updatePanelMesh();
return;
}
Let me know if this seems relevant to you.
Best regards
Wilfrid
In this code its appears there's a bug in the cPanel constructor, and it seems that an `updatePanelMesh()` function is required for it to work. Tested with a BMP image and the `NEW_CHAI3D_BLACK_LOGO()` function.
//
// LOGO CHAI3D
//
// load image file
bool logo = bitmapLogo->loadFromFile(RESOURCE_PATH("../resources/images/chai3d.bmp"));
if (!logo)
{
#if defined(_MSVC)
logo = bitmapLogo->loadFromFile("../../../bin/resources/images/chai3d.bmp");
#endif
if (!logo)
{
cout << "Error - Image failed to load correctly." << endl;
close();
return (-1);
}
}
cout << "Logo chai3d - Image load correctly." << endl;
// add bitmap to front layer
camera->m_frontLayer->addChild(bitmapLogo);
//
Proposed fix:
void cPanel::set(const double& a_width,
const double& a_height,
const double& a_radiusTopLeft,
const double& a_radiusTopRight,
const double& a_radiusBottomLeft,
const double& a_radiusBottomRight)
{
// check values
if ((m_width == a_width) &&
(m_height == a_height) &&
(m_panelRadiusTopLeft == a_radiusTopLeft) &&
(m_panelRadiusTopRight == a_radiusTopRight) &&
(m_panelRadiusBottomLeft == a_radiusBottomLeft) &&
(m_panelRadiusBottomRight == a_radiusBottomRight))
{
// update model of panel
updatePanelMesh();
return;
}
Let me know if this seems relevant to you.
Best regards
Wilfrid
Please Log in or Create an account to join the conversation.
