Q : Transparent background for renderToClipboard() ?

 From:  Elang
12083.1 
Hello ...

So, I have this script to 'capture' the current active viewport into the system clipboard.
Is there any way to make the exported image background to be transparent?

Here is the script by the way, which currently generate the viewport on a white background:
code:
var vp = moi.ui.getLastClickedViewport();

if (!vp) { vp = moi.ui.mainWindow.viewpanel.getViewport('3D'); }

var viewportName = vp.name.toUpperCase();

var st = [], settings = [
	'view.viewportBackgroundColor',
	'view.lineWidth',
	'grid.display',
	'grid.showXYAxes',
	'view.showAxisIcon',
	'view.meshAngle'
	];
	
for (var sv in settings)
{ st.push(moi[settings[sv].split('.')[0]][settings[sv].split('.')[1]]); }

moi.view.viewportBackgroundColor = 0xFFFFFF;
moi.view.lineWidth = 3;
moi.grid.display = false;
moi.grid.showXYAxes = false;
moi.view.showAxisIcon = false;
moi.view.meshAngle = 3;

vp.renderToClipboard(4000, 2500);

for (var sv in settings)
{ moi[settings[sv].split('.')[0]][settings[sv].split('.')[1]] = st.shift(); }

moi.ui.alert(
	'\nViewport ' +
	viewportName +
	' telah berhasil disalin' +
	'        \n' +
	'ke dalam clipboard gambar.\n
	);


The 'exported to clipboard' image will be used to create various illustrative needs in software such as CorelDraw,
so an image of the objects on transparent background will be very much useful instead on white one.


Thank you very much in advance.
- Elang

EDITED: 14 Aug by ELANG