[Scilab-users] How to print GUI window?

classic Classic list List threaded Threaded
40 messages Options
12
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] How to print GUI window?

Hello,
I am attempting to print the GUI window using various commands in a callback
function.

A Java exception occurs.
For example the following is the error in the console window:

printfigure: A Java exception arisen:
Exception when calling Java method :
org.scilab.modules.gui.bridge.tab.SwingScilabStaticPanel cannot be cast to
org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel
 at org.scilab.modules.gui.bridge.CallScilabBridge.printFigure(Unknown
Source)

Is this a bug in Scilab?
How do you directly print a GUI window in Scilab?
Exporting window image to a file and then opening other software to print is
unacceptable.
Thanks for the effort to resolve this issue.

Please advise,
Ted




--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

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.
There are three push buttons and list boxes.
The push buttons have call backs.
One to open a windows file dialog window. Which works correctly.
The call back routine includes code to read an Excel file, plot data,
and fill the list boxes with data.
The second push button closes the Scilab session. This works correctly.
The third push button includes the printfigure(get(gcf(), "figure_id"))
command.
This command opens the windows print dialog correctly.
However, when the dialog print selection is clicked the following Java
exception occurs.

printfigure: A Java exception arisen:
Exception when calling Java method :
org.scilab.modules.gui.bridge.tab.SwingScilabStaticPanel cannot be cast to
org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel
 at org.scilab.modules.gui.bridge.CallScilabBridge.printFigure(Unknown
Source)
org.scilab.modules.gui.bridge.tab.SwingScilabStaticPanel cannot be cast to
org.scilab.modules.gui.bridge.tab.SwingScilabDockablePanel
 at org.scilab.modules.gui.bridge.CallScilabBridge.printFigure(Unknown
Source)

Hope this helps troubleshoot the Scilab environment.
Please advise,
Ted





--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Le 01/08/2019 à 20:34, VTX1801 a écrit :
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.

There are potentially 2 issues :

  1. your GUI is not dockable. The java error message you get is about that.
  2. 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.

So, for the time being, it looks hard to not use an external software to export the GUI as an image.
Fortunately, softwares can be called from Scilab.
You will find here-below some code to be run on Windows (it's your OS, according to your report).
It uses the famous IrfanView free software.
This code works perfectly for me. It should be easily adaptable to your case.

Best regards.
Samuel


// Generate a GUI (from demos)
exec("SCI/modules/gui/demos/uicontrol_plot3d.dem.sce",-1);

f = findobj("figure_id",100001);
f.figure_position([1 2]) = [0 0];   // Imposes the GUI position on the screen
f.visible = "on";                   // Brings the GUI window on the front
s = f.figure_size;

filename = "capture_$U(Y-%m-%d %H%M%S).png"; // with a timestamp in the file name
filename = "capture.png";                    // simple fixed file name
iview_path = findfileassociation(".png");    // or replace with the fixed known path
                                             // to IrfanView .exe on your computer
cmd = "%s /capture=7=(0,0,%d,%d) /convert=%s";
cmd = msprintf(cmd, iview_path, s(1), s(2), filename);
status = host(cmd);
winopen(filename);


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Further testing an some progress.

Suggestion of GUI window not dockable.
Looked at the properties of the figure and there is a dockable property.
The dockable property was set to 'off'.
Set the dockable property to 'on'.

Executed print command and no Java exception error.

figid = f("figure_id");
disp(figid);
status = printfigure(figid);
disp(status);

Console displays 0 for figid.
Console displays T for status.

One page is printed on the printer.
However, the printed image is about one third of the plot figure only.
As though the scale of the print is zoomed in.

Looking for some property to set print to scale whole image to fill printed
sheet.
Is there a Scilab printer property for this purpose?

Suggestions?
Please advise,
Ted




--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Le 01/08/2019 à 23:04, VTX1801 a écrit :
Further testing an some progress.

Suggestion of GUI window not dockable.
Looked at the properties of the figure and there is a dockable property.
The dockable property was set to 'off'. 
Set the dockable property to 'on'.

Executed print command and no Java exception error.

Great.

figid = f("figure_id");
disp(figid);
status = printfigure(figid);
disp(status);

Console displays 0 for figid.
Console displays T for status.

One page is printed on the printer.
However, the printed image is about one third of the plot figure only.
As though the scale of the print is zoomed in.

Looking for some property to set print to scale whole image to fill printed sheet.
Is there a Scilab printer property for this purpose?


Not AFAIK, even through printsetupbox().
But you can resize the GUI before exporting it, through its handle with f.axes_size.

Could you please try with the trivial example below and check whether the uicontrol appears on the image (before planning to resize and print it ;-):

plot2d()
uicontrol("style","text","string","Test","position",[10,10,100,20]);
xs2png(gcf(),"test.png")
winopen("test.png")


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Copied your test code to new Scilab program.
Ran the code.
Graphic window appears with plot graph and uicontrol text object at the
bottom with the word Test.
Photos.test window appears with only the plot graph.
The uicontrol is missing.

Is the plot graph the graphic that is exported?
Do you need to assign the whole figure to export?

Please advise,
Ted






--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Le 01/08/2019 à 23:40, VTX1801 a écrit :
Copied your test code to new Scilab program.
Ran the code.
Graphic window appears with plot graph and uicontrol text object at the
bottom with the word Test.
Photos.test window appears with only the plot graph.
The uicontrol is missing.


So the bug 14502 is still alive, as expected and already checked.

Is the plot graph the graphic that is exported?
Do you need to assign the whole figure to export?

I don't understand what is Photos.test, and your questions.
The scripts only generate in your working directory a test.png or capture.png image file -- that is the export/capture of the figure --, and opens it in your image viewer.



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by Samuel GOUGEON
Le 01/08/2019 à 21:50, Samuel Gougeon a écrit :

// Generate a GUI (from demos)
exec("SCI/modules/gui/demos/uicontrol_plot3d.dem.sce",-1);

f = findobj("figure_id",100001);
f.figure_position([1 2]) = [0 0];   // Imposes the GUI position on the screen
f.visible = "on";                   // Brings the GUI window on the front
s = f.figure_size;

filename = "capture_$U(Y-%m-%d %H%M%S).png"; // with a timestamp in the file name
filename = "capture.png";                    // simple fixed file name
iview_path = findfileassociation(".png");    // or replace with the fixed known path
                                             // to IrfanView .exe on your computer
cmd = "%s /capture=7=(0,0,%d,%d) /convert=%s";
cmd = msprintf(cmd, iview_path, s(1), s(2), filename);
status = host(cmd);
winopen(filename);


Other Irfanview command-line options exist and can be included in the command string, to print the capture even without saving it in any file, namely: /aspectratio /resize_long=size /resize_short=size /rotate_r /rotate_l /print  etc

The irfanview help is extensive and very clear, with many examples.



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Le 01/08/2019 à 23:40, VTX1801 a écrit :
Copied your test code to new Scilab program.
Ran the code.
Graphic window appears with plot graph and uicontrol text object at the
bottom with the word Test.
Photos.test window appears with only the plot graph.
The uicontrol is missing.

Is the plot graph the graphic that is exported?
Do you need to assign the whole figure to export?

Here is another version of the code, to capture only the graphical area, without the window borders:

// Generate a GUI (from demos)
exec("SCI/modules/gui/demos/uicontrol_plot3d.dem.sce",-1);

f = findobj("figure_id",100001);
f.visible = "on";                   // Brings the GUI window on the front
fs = f.figure_size;
as = f.axes_size;
border_width = (fs(1)-as(1))/2;
header_height = fs(2)-as(2)-border_width;
// Hiding the left border and header of the window out of screen 
f.figure_position([1 2]) = [-border_width -header_height];

filename = "capture_$U(Y-%m-%d %H%M%S).png"; // with a timestamp in the file name
filename = "capture.png";                    // simple fixed file name
iview_path = findfileassociation(".png");    // or replace with the fixed known path
                                             // to IrfanView on your computer
cmd = "%s /capture=7=(0,0,%d,%d) /convert=%s";
cmd = msprintf(cmd, iview_path, as(1), as(2), filename);
status = host(cmd);
winopen(filename);

Samuel


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by Samuel GOUGEON
Photos is the default image viewer.
The question regarding the figure is:
Are the plot and the uicontrol considered children of the figure?
Is there a syntax that would include all children of the figure to print?



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Le 02/08/2019 à 00:13, VTX1801 a écrit :
> Photos is the default image viewer.
> The question regarding the figure is:
> Are the plot and the uicontrol considered children of the figure?
Yes
> Is there a syntax that would include all children of the figure to print?
It already the  case: only the whole figure can be exported/printed.
The fact that uicontrols do not appear IS the bug 14502.

So, again, this is why you can't escape using an external software to
get around it.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Tried your alternate code.
Window appeared with 3d graphic.
Menu was off the screen.
Ran again and menu on screen.

Got the following error in console:

msprintf: Wrong number of input arguments: data doesn't fit with format.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Thanks for the effort to resolve this issue.
If this has been a known bug since 2016 what is the likelihood it will be
addressed and resolved?
I appreciate the timely responses from Samuel.
Evidently Scilab is not mature enough to use for this application.
Best Regards,
Ted





--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Mh...
From what I understnad is, that you want to get a print out from your current GUI appearance.

As Samuel suggested, one workaround is to make a screenshot, by calling IrfanView from Scilab.

The result is an image, that:
- can be printed out in a normal way...e.g. by use of IrfanView
- can be loaded into scilab (need maybe a toolbox) and printed directly from scilab


Note:
In the example below, the screenshot is taken from the currently foreground window (client area).
So I guess you need to make sure, that all uicontrols are placed in the same scilab figure.
If not, you can probably capture the complete screen, after arranging separate figures and use irfan view command line command (in scilab) to crop the resulting image.



// ################## Beginning of Code ################

clear();
clc;

mainDir = 'E:\Scilab_Uebungen\031_call_software\'       // you may want to change this
cd (mainDir);
pwd;

h = figure('position', [50 50 400 400], 'backgroundcolor', [0.7 0.9 1], ..
"figure_name", 'WHAT DAY WERE YOU BORN?');
// to have a plot within the GUI
plot2d();

// text
T1 = uicontrol(h, 'style', 'text', 'string', 'Type year:','position', [20 340 200 50], 'backgroundcolor', [0.7 0.9 1]);
// edit
E1 = uicontrol(h, 'style', 'edit', 'string', '9999', 'position', [150 350 70 30], 'fontsize', 15, 'backgroundcolor', [1 1 1]);
// text
T2 = uicontrol(h, 'style', 'text', 'string', 'Select month:','position', [20 260 200 50], 'backgroundcolor', [0.7 0.9 1]);
// listbox 
L1 = uicontrol(h, 'style', 'listbox', 'position', [150 130 120 170], 'fontsize', 15, 'backgroundcolor', [1 1 1]);
set(L1, 'string', 'January |February |March |April |May |June |July |August |September |October |November |December'); 
set(L1, 'value', [2]);
// text
T3 = uicontrol(h, 'style', 'text', 'string', 'Type day:', 'position', [20 60 200 50], 'backgroundcolor', [0.7 0.9 1]);
// edit
E2 = uicontrol(h, 'style', 'edit', 'string', '12', 'position', [150 70 70 30], 'fontsize', 15, 'backgroundcolor', [1 1 1]);

// callback function for push button
// seems that this has to be defined before the bush button is generated
function birthday(guientries)
    y       = evstr(get(E1, 'string'))
    m       = get(L1, 'value')
    d       = evstr(get(E2, 'string'))
    num     = datenum(y, m, d);
    [n, s]  = weekday(num); 
    disp('You were born on '+s)
    
    // access IrfanView and try to make a screen shot of the GUI
    IV_PATH     = 'C:\Program Files (x86)\IrfanView';                           // check if this is true for your system
    OUT_PATH    = 'E:\Scilab_Uebungen\031_call_software'               // you may want to change this


    // capture the GUI crop it, so that figure borders are not visible anymore and save it as a png file
    cd (IV_PATH);   
    dos('i_view32.exe /capture=3 /crop=(0,47,0,420,0) /convert='+OUT_PATH+'\test.png ');
    cd (mainDir);    
    pwd;

endfunction
// push button
P1 = uicontrol(h, 'position', [300 70 80 30], 'style', 'pushbutton', 'string', 'Submit', 'callback', 'birthday', 'backgroundcolor', [1 1 0]);


// ################## End of Code ###########################

Attached the result as it is created at my PC.

Hope this helps,
best regards,
Philipp

ps.

From http://www.etcwiki.org/wiki/IrfanView_Command_Line_Options
capture values:
0 = whole screen
1 = current monitor, where mouse is located
2 = foreground window
3 = foreground window - client area
4 = rectangle selection
5 = object selected with the mouse
6 = start in capture mode (can't be combined with other commandline options)

Am Fr., 2. Aug. 2019 um 01:02 Uhr schrieb VTX1801 <[hidden email]>:
Thanks for the effort to resolve this issue.
If this has been a known bug since 2016 what is the likelihood it will be
addressed and resolved?
I appreciate the timely responses from Samuel.
Evidently Scilab is not mature enough to use for this application.
Best Regards,
Ted





--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

test.png (20K) Download Attachment
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Hello Philipp, hello Ted,

Yesterday evening, I got aware of two important drawbacks of using Irfanview, despite its numerous and  huge assets and qualities:
  • It runs only on Windows
  • It is free only for non-commercial usages

...in addition to the fact that it must be installed (trivial, but OK).

These restrictions made me wondering about a more portable solution.
And gui2bitmap() is born :-)  http://atoms.scilab.org/toolboxes/gui2bitmap

The printing is also worth considering.
I should have a look later to this matter, for instance to see if it is possible
and then how to print directly the snapshot with gui2bitmap, instead of
keeping an image file.
The discussion with Ted made me aware that presently Scilab seems not
able to send any image to a printer. This is a missing feature.

Best regards
Samuel

Le 02/08/2019 à 14:08, P M a écrit :
Mh...
From what I understnad is, that you want to get a print out from your current GUI appearance.

As Samuel suggested, one workaround is to make a screenshot, by calling IrfanView from Scilab.

The result is an image, that:
- can be printed out in a normal way...e.g. by use of IrfanView
- can be loaded into scilab (need maybe a toolbox) and printed directly from scilab


Note:
In the example below, the screenshot is taken from the currently foreground window (client area).
So I guess you need to make sure, that all uicontrols are placed in the same scilab figure.
If not, you can probably capture the complete screen, after arranging separate figures and use irfan view command line command (in scilab) to crop the resulting image.



// ################## Beginning of Code ################

clear();
clc;

mainDir = 'E:\Scilab_Uebungen\031_call_software\'       // you may want to change this
cd (mainDir);
pwd;

h = figure('position', [50 50 400 400], 'backgroundcolor', [0.7 0.9 1], ..
"figure_name", 'WHAT DAY WERE YOU BORN?');
// to have a plot within the GUI
plot2d();

// text
T1 = uicontrol(h, 'style', 'text', 'string', 'Type year:','position', [20 340 200 50], 'backgroundcolor', [0.7 0.9 1]);
// edit
E1 = uicontrol(h, 'style', 'edit', 'string', '9999', 'position', [150 350 70 30], 'fontsize', 15, 'backgroundcolor', [1 1 1]);
// text
T2 = uicontrol(h, 'style', 'text', 'string', 'Select month:','position', [20 260 200 50], 'backgroundcolor', [0.7 0.9 1]);
// listbox 
L1 = uicontrol(h, 'style', 'listbox', 'position', [150 130 120 170], 'fontsize', 15, 'backgroundcolor', [1 1 1]);
set(L1, 'string', 'January |February |March |April |May |June |July |August |September |October |November |December'); 
set(L1, 'value', [2]);
// text
T3 = uicontrol(h, 'style', 'text', 'string', 'Type day:', 'position', [20 60 200 50], 'backgroundcolor', [0.7 0.9 1]);
// edit
E2 = uicontrol(h, 'style', 'edit', 'string', '12', 'position', [150 70 70 30], 'fontsize', 15, 'backgroundcolor', [1 1 1]);

// callback function for push button
// seems that this has to be defined before the bush button is generated
function birthday(guientries)
    y       = evstr(get(E1, 'string'))
    m       = get(L1, 'value')
    d       = evstr(get(E2, 'string'))
    num     = datenum(y, m, d);
    [n, s]  = weekday(num); 
    disp('You were born on '+s)
    
    // access IrfanView and try to make a screen shot of the GUI
    IV_PATH     = 'C:\Program Files (x86)\IrfanView';                           // check if this is true for your system
    OUT_PATH    = 'E:\Scilab_Uebungen\031_call_software'               // you may want to change this


    // capture the GUI crop it, so that figure borders are not visible anymore and save it as a png file
    cd (IV_PATH);   
    dos('i_view32.exe /capture=3 /crop=(0,47,0,420,0) /convert='+OUT_PATH+'\test.png ');
    cd (mainDir);    
    pwd;

endfunction
// push button
P1 = uicontrol(h, 'position', [300 70 80 30], 'style', 'pushbutton', 'string', 'Submit', 'callback', 'birthday', 'backgroundcolor', [1 1 0]);


// ################## End of Code ###########################

Attached the result as it is created at my PC.

Hope this helps,
best regards,
Philipp

ps.

From http://www.etcwiki.org/wiki/IrfanView_Command_Line_Options
capture values:
0 = whole screen
1 = current monitor, where mouse is located
2 = foreground window
3 = foreground window - client area
4 = rectangle selection
5 = object selected with the mouse
6 = start in capture mode (can't be combined with other commandline options)

Am Fr., 2. Aug. 2019 um 01:02 Uhr schrieb VTX1801 <[hidden email]>:
Thanks for the effort to resolve this issue.
If this has been a known bug since 2016 what is the likelihood it will be
addressed and resolved?
I appreciate the timely responses from Samuel.
Evidently Scilab is not mature enough to use for this application.
Best Regards,
Ted

--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Philipp,
Thanks for contributing your time and effort to resolve this issue with a
work around.

The following error is produced when the push button is clicked"

cd: Cannot go to directory C:\Program Files (x86)\IrfanView

Obviously, I do not have IrfanView software installed on my laptop/

Therefore, for this work around to be implemented does everyone who is a
client of this Scilab code need to install IrfanView software?

Or, will the Scilab executable that will be distributed to clients need to
install IrfanView software?
Additionally, does the output file directory need to be identical on all
client PCs?

Lastly, the uicontrols all appear to be within the boundaries of the graph
plot.
This is not acceptable.
The spreadsheet data needs to plot unobscurred and the are several list
boxes that will have various data displayed.

Again, it would be far better to fix the bug in Scilab than to require all
this effort for a work around solution.

Best Regards,
Ted





--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

...to start with: I guess you try the gui2bitmap toolbox....

To answer your questions:
You need to download & install IrfanView on your Laptop.
Make sure that the IrfanView install path in your code is exactly as it is on your machine.
Besides of this: You may already have IrfanView installed, but it may be on a different path...so Scilab would no find the folder.

I do not know how Scilab would automatically install IrfanView.

Yes, everybody who use the code would have to have IrfanView installed.
Also the path variable would have to be the same, if you do not want to change code for each of your clients.

Output file directory:
The path is of your choice and can be differnt for each client who runs the code.
If the output folder does not exist, you can create it in Scilab using mkdir (I think)

Quote:
Lastly, the uicontrols all appear to be within the boundaries of the graph
plot. This is not acceptable.

What do you mean exactly?
In the example I gave, I just plot a figure without placing it at a specific location within the figure.
The goal was, to test if the plot is captured at all, or if it wil become a white area.
So the other uicontrols a "on top" of it.
You can easely rearrange the position of each uicontrol, so that they are not "overlaying" each other.


Best regards,
Philipp





 

Am Fr., 2. Aug. 2019 um 16:30 Uhr schrieb VTX1801 <[hidden email]>:
Philipp,
Thanks for contributing your time and effort to resolve this issue with a
work around.

The following error is produced when the push button is clicked"

cd: Cannot go to directory C:\Program Files (x86)\IrfanView

Obviously, I do not have IrfanView software installed on my laptop/

Therefore, for this work around to be implemented does everyone who is a
client of this Scilab code need to install IrfanView software?

Or, will the Scilab executable that will be distributed to clients need to
install IrfanView software?
Additionally, does the output file directory need to be identical on all
client PCs?

Lastly, the uicontrols all appear to be within the boundaries of the graph
plot.
This is not acceptable.
The spreadsheet data needs to plot unobscurred and the are several list
boxes that will have various data displayed.

Again, it would be far better to fix the bug in Scilab than to require all
this effort for a work around solution.

Best Regards,
Ted





--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

Le 02/08/2019 à 21:12, P M a écrit :
...to start with: I guess you try the gui2bitmap toolbox....

To answer your questions:
You need to download & install IrfanView on your Laptop.
Make sure that the IrfanView install path in your code is exactly as it is on your machine.
Besides of this: You may already have IrfanView installed, but it may be on a different path...so Scilab would no find the folder.

I do not know how Scilab would automatically install IrfanView.

Yes, everybody who use the code would have to have IrfanView installed.
Also the path variable would have to be the same, if you do not want to change code for each of your clients.

The following can be used to get the path to the Irfanview executable,
even if Irfanview is not associated to any image extension:

try
    subkey = "SOFTWARE\IrfanView\shell\open\command";
    iview_path = winqueryreg("HKEY_LOCAL_MACHINE", subkey);
catch
    msg = _("%s: IrfanView software not found.\n")
    error(msprintf(msg, "This application"))
end
If "clients" means "Customers", then, Ted, you should have a look to the Irfanview license before processing.

Regards
Samuel



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Samuel,
Is gui2bitmap() available in the modules?

Tried the following code to install gui2bitmap():

atomsInstall("gui2bitmap")
atomsInstallList: The package "gui2bitmap" is not registered.
Please check on the ATOMS repository that it is available for Scilab 6.0 on
Windows.
If it is, run atomsSystemUpdate() before trying atomsInstall(..) again.

at line    52 of function atomsError       ( C:\Program
Files\scilab-6.0.2\modules\atoms\macros\atoms_internals\atomsError.sci line
66 )
at line    78 of function atomsInstallList ( C:\Program
Files\scilab-6.0.2\modules\atoms\macros\atoms_internals\atomsInstallList.sci
line 117 )
at line   233 of function atomsInstall     ( C:\Program
Files\scilab-6.0.2\modules\atoms\macros\atomsInstall.sci line 249 )



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
VTX1801 VTX1801
Reply | Threaded
Open this post in threaded view
|

Re: How to print GUI window?

In reply to this post by VTX1801
Spoke too soon.
Had to run the atomsSystemUpdate() first.

Then:

atomsInstall("gui2bitmap")
 ans  =

!gui2bitmap  1.0  user  SCIHOME\atoms\x64\gui2bitmap\1.0  I  !

I a m certain that if this works your effort will be greatly appreciated by
all users.
I will investigate.

Best regards,
Ted




--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
12