Export to image using active camera orientation and transparent background
I would like the Image output feature of File > Export selected items to obey the current camera view in the UI, if possible. It would be great to have also a transparent background option when using formats that support it (such as PNG).
The Save View to image feature is not the same, because it also outputs the grid and controls.
Thanks for this wonderful piece of software! 😎
Unfortunately, to my knowledge OpenCascade 3D view doesn't support transparent background
OK, what a pity, it could have been useful to integrate into other apps... anyway, at least saving with same orientation could be enough 😃
Unfortunately, to my knowledge OpenCascade 3D view doesn't support transparent background
Hi, sorry if I reply again, but I found this question on the OpenCascade forums. I'm not really a C++ expert (actually I'm not a programmer at all), but could it be that changing this: https://github.com/fougue/mayo/blob/3b4d7e6f67f6c49a0a777a6eaa00a2f21998d0e5/src/io_image/io_image.cpp#L191
to Graphic3d_BT_RGBA and providing the alpha component might work with PNG?
I tried this but couldn't make it work:
- create a transparent PNG file
- call
V3d_View::SetBackgroundImage()with this PNG file(withinImageWriter::createV3dView()function) - set
dumpOptions.BufferType = Graphic3d_BT_RGBA;(withinImageWriter::createV3dView()function) - set
pixmap->SetFormat(Image_Format_RGBA);(withinImageWriter::createV3dView()function) - map
QImage::Format_RGBA8888toImage_Format_RGBAin functiontoQPixmap()(withinqtgui_utils.cppfile)
The problem certainly lies with V3d_View not supporting transparent background(no alpha color channel)
- create a transparent PNG file
- call
V3d_View::SetBackgroundImage()with this PNG file(withinImageWriter::createV3dView()function)
Why is it necessary to use SetBackgroundImage()? I would like the created image to be transparent, not to add a transparent image as a background. But I see now that V3d_View::SetBackgroundColor() doesn't have options for RGBA 😢 so probably we're in trouble.