<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 01/08/2019 à 20:34, VTX1801 a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:1564684480905-0.post@n3.nabble.com">
<pre class="moz-quote-pre" wrap="">Hello,
Further test with a simple plot figure does print correctly.
So this issue is somehow related to a larger window GUI with multiple
objects including a plot.</pre>
</blockquote>
<p>There are potentially 2 issues : <br>
</p>
<ol>
<li>your GUI is not dockable. The java error message you get is
about that.</li>
<li>Even with a dockable GUI, AFAIK and as you can check the
export fails as soon as there is a uicontrol component in the
exported figure : it yields to a white image.</li>
</ol>
<p>So, for the time being, it looks hard to not use an external
software to export the GUI as an image.<br>
Fortunately, softwares can be called from Scilab.<br>
You will find here-below some code to be run on Windows (it's your
OS, according to your report).<br>
It uses the famous IrfanView free software. <br>
This code works perfectly for me. It should be easily adaptable to
your case.<br>
<br>
Best regards.<br>
Samuel <br>
</p>
<br>
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><tt><span style="color:rgb(100,174,100);font-style:italic;">// Generate a GUI (from demos)</span></tt><tt>
</tt><tt><span style="color:rgb(50,185,185);">exec</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">SCI/modules/gui/demos/uicontrol_plot3d.dem.sce</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(0,0,0);">,</span></tt><tt><span style="color:rgb(92,92,92);">-</span></tt><tt><span style="color:rgb(188,143,143);">1</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">f</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(174,92,176);text-decoration:underline;">findobj</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">figure_id</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(0,0,0);">,</span></tt><tt><span style="color:rgb(188,143,143);">100001</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">f</span></tt><tt><span style="color:rgb(92,92,92);">.</span></tt><tt><span style="color:rgb(170,170,170);">figure_position</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(74,85,219);">[</span></tt><tt><span style="color:rgb(188,143,143);">1</span></tt><tt> </tt><tt><span style="color:rgb(188,143,143);">2</span></tt><tt><span style="color:rgb(74,85,219);">]</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(74,85,219);">[</span></tt><tt><span style="color:rgb(188,143,143);">0</span></tt><tt> </tt><tt><span style="color:rgb(188,143,143);">0</span></tt><tt><span style="color:rgb(74,85,219);">]</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt> </tt><tt><span style="color:rgb(100,174,100);font-style:italic;">// Imposes the GUI position on the screen</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">f</span></tt><tt><span style="color:rgb(92,92,92);">.</span></tt><tt><span style="color:rgb(170,170,170);">visible</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">on</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt> </tt><tt><span style="color:rgb(100,174,100);font-style:italic;">// Brings the GUI window on the front</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">s</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(0,0,0);">f</span></tt><tt><span style="color:rgb(92,92,92);">.</span></tt><tt><span style="color:rgb(170,170,170);">figure_size</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">filename</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">capture_$U(Y-%m-%d %H%M%S).png</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt> </tt><tt><span style="color:rgb(100,174,100);font-style:italic;">// with a timestamp in the file name</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">filename</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">capture.png</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt> </tt><tt><span style="color:rgb(100,174,100);font-style:italic;">// simple fixed file name</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">iview_path</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(50,185,185);">findfileassociation</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">.png</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt> </tt><tt><span style="color:rgb(100,174,100);font-style:italic;">// or replace with the fixed known path</span></tt><tt>
</tt><tt><span style="color:rgb(100,174,100);font-style:italic;">// to IrfanView .exe on your computer</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">cmd</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(188,143,143);">%s /capture=7=(0,0,%d,%d) /convert=%s</span></tt><tt><span style="color:rgb(188,143,143);">"</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">cmd</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(50,185,185);">msprintf</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(0,0,0);">cmd</span></tt><tt><span style="color:rgb(0,0,0);">,</span></tt><tt> </tt><tt><span style="color:rgb(0,0,0);">iview_path</span></tt><tt><span style="color:rgb(0,0,0);">,</span></tt><tt> </tt><tt><span style="color:rgb(0,0,0);">s</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(188,143,143);">1</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">,</span></tt><tt> </tt><tt><span style="color:rgb(0,0,0);">s</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(188,143,143);">2</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">,</span></tt><tt> </tt><tt><span style="color:rgb(0,0,0);">filename</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt>
</tt><tt><span style="color:rgb(0,0,0);">status</span></tt><tt> </tt><tt><span style="color:rgb(92,92,92);">=</span></tt><tt> </tt><tt><span style="color:rgb(50,185,185);">host</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(0,0,0);">cmd</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><tt><span style="color:rgb(0,0,0);">;</span></tt><tt>
</tt><tt><span style="color:rgb(50,185,185);">winopen</span></tt><tt><span style="color:rgb(74,85,219);">(</span></tt><tt><span style="color:rgb(0,0,0);">filename</span></tt><tt><span style="color:rgb(74,85,219);">)</span></tt><span style="color:rgb(0,0,0);"><tt>;</tt><tt>
</tt>
</span></pre>
</body>
</html>