[Scilab-users] Exporting figures containing uicontrols to any format

Philipp Mühlmann p.muehlmann at gmail.com
Fri Nov 4 23:46:04 CET 2016


pittywise   driver()   does also not brings the solution

interstingly playing with usecanvas()  made it possible to only show
pushbuttons in a figure.

e.g.:
usecanvas(%T);

f=figure();plot2d();h=uicontrol(f,'unit','normalized',"style","pushbutton","string","pushbutton",
'Position',[0.1, 0.7, 0.2,
0.1]);h=uicontrol(f,'unit','normalized',"style","frame","string","frame",
'Position',[0.1, 0.5, 0.2, 0.1]);


but expoting this figure as a image file resulted in having the know style.
no pushbuttons rendered, only the figure of plot2d().....(also not the
frame)




2016-11-04 1:50 GMT+01:00 Philipp Mühlmann <p.muehlmann at gmail.com>:

> it seems that:
>
> exportUI() only recognizes figure handles (and axes) for the export.
>
> since pushbuttons etc. are not figure handles they are not exported?
>
>
> e.g.: handles.mypushbotton.style = "pushbutton"
>
> ...should be maybe "figure", "frame" or "axes" to be recognized by
> exportUI().
>
> Seems to be the same with "printfigure()"
>
>
>
>
> sidequestion:
>
> Is it possible to export content of a xml-file to an figure/image?
>
> If so one could maybe use:
>
>    saveGui(gcf(), 'screenshot.xml');
>
> and than convert the content of the xml file into an image?
>
>
>
>
>
>
>
>
>
> 2016-11-03 23:08 GMT+01:00 Philipp Mühlmann <p.muehlmann at gmail.com>:
>
>> Dear all,
>>
>> searching a little how GUI's can be "screenshotted" in Matlab gave me
>> following:
>>
>> Request on a Matlab forum, see:
>>
>> https://de.mathworks.com/matlabcentral/newsreader/view_thread/146264
>>
>> [...] " In order to show users without atlab on their desktop the output,
>> i want to create a export function."
>>
>> This could be the reason for having the oppertunity of screenshotting a
>> GUI.
>>
>> Anyways:
>>
>> to me it seems that following is needed to do the trick:
>>
>> [name,path,index] = uiputfile
>> saveas(guifigurehandle,[path name]);
>>
>> while   "saveas" calls  "print"
>> see "ocatave" code:            https://fossies.org/dox/octave
>> -4.0.3/saveas_8m_source.html
>>
>> The print.m code is than way beyond my code understanding.
>> see "ocatave" code:            https://fossies.org/dox/octave
>> -4.0.3/print_8m_source.html
>>
>>
>> best regards,
>> Phil
>>
>>
>>
>>
>>
>>
>> 2016-11-02 23:07 GMT+01:00 Rafael Guerra <jrafaelbguerra at hotmail.com>:
>>
>>> Hi Antoine,
>>>
>>> I do not have an answer but a question, if you will.
>>> Why is it important for you to export the whole shebang from Scilab?
>>>
>>> For the regular figures the export functions work fine and generate
>>> high-resolution post-script files.
>>> For the GUI figures, using external screen capture software does not
>>> seem to me to be a big handicap, but I might be wrong and I therefore raise
>>> the question.
>>>
>>> Thanks and regards,
>>> Rafael
>>>
>>>
>>> -----Original Message-----
>>> From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of
>>> Antoine Monmayrant
>>> Sent: Tuesday, November 01, 2016 9:41 PM
>>> To: Users mailing list for Scilab <users at lists.scilab.org>
>>> Subject: [Scilab-users] Exporting figures containing uicontrols to any
>>> format
>>>
>>> Hi everyone,
>>>
>>> After a long fight to build fancy graphics with uicontrols to demo some
>>> physics, I am now stuck because of bug 14502 (
>>> https://bugzilla.scilab.org/show_bug.cgi?id=14502 ).
>>> Basically, I have no way to export my figure to any format (ie no
>>> exportUI(gcf()) and no xs2something).
>>> As any of you ever managed to export a figure with uicontrols where both
>>> the plots and the uicontrols are well rendered?
>>>
>>> Antoine
>>>
>>> PS: for a bit of context, try the following:
>>>
>>> 1) Demos->GUI->Uicontrols 2 //(or any with uicontrols)
>>> 2) h=gcf();xs2svg(h, 'h.svg'); // or any other format
>>> 3) open h.svg, it's empty
>>>
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>
>>
>>
>> --
>> In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.
>>
>> There we have the salad.
>>
>
>
>
> --
> In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.
>
> There we have the salad.
>



-- 
In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.

There we have the salad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161104/8e5d6e25/attachment.htm>


More information about the users mailing list