[Scilab-users] gui2bitmap 1.0 is released

classic Classic list List threaded Threaded
16 messages Options
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] gui2bitmap 1.0 is released

Hello,

I am glad to announce the first release of the gui2bitmat package :
https://atoms.scilab.org/toolboxes/gui2bitmap

gui2bitmap() aims to export into a .png | .jpg | .gif | .bmp bitmap image
any graphical figure or User Interface with interactive components (uicontrols).
An option allows to get the image of the full window, including its
border/frame (with its menus bar, tools bar, status bar, and other bars ;-)

It is a stand-alone function (no thirdparty needed), easy to use and easy to maintain
(no hard code to recompile from a Scilab version to next ones).

It is tested on Windows, but it should run as well on Linux and MacOS.
It is fully documented.

Enjoy.
Samuel

-----------------------

gui2bitmap

get a bitmap image of a graphical figure or interface, including its uicontrols, nay window borders

SYNTAXES
--------
gui2bitmap(idFig, filename)
gui2bitmap(idFig, filename, withBorders)

idFig      : handle of the figure
filename   : pathname to the output image file
withBorders: boolean

PDF page:
--------
English: https://atoms.scilab.org/toolboxes/gui2bitmap/1.0/files/gui2bitmap_1.0_en.pdf
French: https://atoms.scilab.org/toolboxes/gui2bitmap/1.0/files/gui2bitmap_1.0_fr.pdf

Bugs reports, comments:
----------------------
http://atoms.scilab.org/toolboxes/gui2bitmap#new_comment



_______________________________________________
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: gui2bitmap 1.0 is released

Hallo Samuel,

I know...old system, but still....

Win XP
Scilab 5.5.2
- Install gui2ibtmap from atoms.


copy paste the first example into the console gives follwing

-->// Generate a nice GUI (from demos)
 -->exec("SCI/modules/gui/demos/uicontrol_plot3d.dem.sce",-1);
 -->//
 -->f = gcf();
 -->f.axes_size = [650 400];
 -->sleep(500)
 -->figGUI = "TMPDIR/gui2bitmap/gui2bitmap.png";
 -->
 -->// Export the window
 -->gui2bitmap(f, figGUI, %t)   // with window borders
  !--error 241
File 'C:\Users\Samuel\Desktop\DOSSIERS\Scilab\scripts\bib\ATOMS\GUI2BI~1\GUI2BI~1.0\GUI2BI~1.0_5\macros\gui2bitmap.bin' does not exist
 
This is true, because on my PC there is no C:\Users\Samuel....


Best regards,
Philipp



Am Fr., 2. Aug. 2019 um 14:29 Uhr schrieb Samuel Gougeon <[hidden email]>:

Hello,

I am glad to announce the first release of the gui2bitmat package :
https://atoms.scilab.org/toolboxes/gui2bitmap

gui2bitmap() aims to export into a .png | .jpg | .gif | .bmp bitmap image
any graphical figure or User Interface with interactive components (uicontrols).
An option allows to get the image of the full window, including its
border/frame (with its menus bar, tools bar, status bar, and other bars ;-)

It is a stand-alone function (no thirdparty needed), easy to use and easy to maintain
(no hard code to recompile from a Scilab version to next ones).

It is tested on Windows, but it should run as well on Linux and MacOS.
It is fully documented.

Enjoy.
Samuel

-----------------------

gui2bitmap

get a bitmap image of a graphical figure or interface, including its uicontrols, nay window borders

SYNTAXES
--------
gui2bitmap(idFig, filename)
gui2bitmap(idFig, filename, withBorders)

idFig      : handle of the figure
filename   : pathname to the output image file
withBorders: boolean

PDF page:
--------
English: https://atoms.scilab.org/toolboxes/gui2bitmap/1.0/files/gui2bitmap_1.0_en.pdf
French: https://atoms.scilab.org/toolboxes/gui2bitmap/1.0/files/gui2bitmap_1.0_fr.pdf

Bugs reports, comments:
----------------------
http://atoms.scilab.org/toolboxes/gui2bitmap#new_comment


_______________________________________________
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: gui2bitmap 1.0 is released

Hello Philipp,

Thanks for the feedback.
I still publish some 5.5.2 binaries because 5.5.2 is still rather used
(and for a while,
because it is the most stable version to date). So it's important that
it runs as expected.

I confirm the issue. I can't understand what occurs. I never put
absolute paths anywhere in my code.
The most puzzling is that, after your message, i just recompiled the
library, repushed to ATOMS
a -1 version of the binary. I have cleaned my local installation,
including the archive.
After atomsSystemUpdate(), now the version -1.bin is downloaded and
installed..
But the issue is still here! For the time being, i just remove the 5.5
release from ATOMS.
Either the issue is from my zipper (but i use the same for the 6.0
binary, and there is not
this issue...!), or from the ATOMS server (that knows the absolute path
when uploading
the zip. This is the only explanation i see for now... But still, why
only for 5.5.2?)

Regards
Samuel

Le 03/08/2019 à 22:03, P M a écrit :

> Hallo Samuel,
>
> I know...old system, but still....
>
> Win XP
> Scilab 5.5.2
> - Install gui2ibtmap from atoms.
>
>
> copy paste the first example into the console gives follwing
> ...

_______________________________________________
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: gui2bitmap 1.0 is released

Le 03/08/2019 à 23:12, Samuel Gougeon a écrit :

> Hello Philipp,
>
> Thanks for the feedback.
> I still publish some 5.5.2 binaries because 5.5.2 is still rather used
> (and for a while,
> because it is the most stable version to date). So it's important that
> it runs as expected.
>
> I confirm the issue. I can't understand what occurs. I never put
> absolute paths anywhere in my code.


...But as an evidence, genlib() does !
Very unexpected, ugly, and unseemly, to store local personal information
in a compiled binary.
By the way, what for?! One does not expect to have any issue if we move
the directory of .bin.

This occurs at least on 5.5.2. genlib() has changed in 6.0. I will have
a look to the source code
to see if this path recording is still implemented.


The issue came from the fact, that in the .start script, the gui2bitmap
library was loaded with load() instead of with lib().
In 5.5.2, load() is able to work without complaining, but badly => error
only at the first call of the library.
In the other hand, lib() may have some reported issue in 6.0.

Anyway, it is now fixed. I have uploaded the binary for 5.5, and it works.
Since there is just one line different in the .start file, i won't
create a new gui2bitmap sub-version for that.
By the way, the uploaded sources are declared to be for 6.0.

Please do not hesitate to confirm that this is now OK as well on your
system.

Best regards
Samuel

> The most puzzling is that, after your message, i just recompiled the
> library, repushed to ATOMS
> a -1 version of the binary. I have cleaned my local installation,
> including the archive.
> After atomsSystemUpdate(), now the version -1.bin is downloaded and
> installed..
> But the issue is still here! For the time being, i just remove the 5.5
> release from ATOMS.
> Either the issue is from my zipper (but i use the same for the 6.0
> binary, and there is not
> this issue...!), or from the ATOMS server (that knows the absolute
> path when uploading
> the zip. This is the only explanation i see for now... But still, why
> only for 5.5.2?)
>
> Regards
> Samuel
>
> Le 03/08/2019 à 22:03, P M a écrit :
>> Hallo Samuel,
>>
>> I know...old system, but still....
>>
>> Win XP
>> Scilab 5.5.2
>> - Install gui2ibtmap from atoms.
>>
>>
>> copy paste the first example into the console gives follwing
>> ...
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
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: gui2bitmap 1.0 is released

After updating Atoms it works now...thanks.

So here are some tests:

Screen: 1280 x 1024 px
Graphic Card: NVIDIA GeForce 210:
View images with IrfanView.

From the 1st example of gui2bitmap.
f.axes_size = [650 400];

1.:  Exporting the figure WITH borders: resulting image is 658 x 448 px
=> +8 px in width
=> + 48px in height
--> understandable, because the toolbar and borders are added to the figure

2.: Exporting the figure WITHOUT borders gives 650 x 400 px...
all OK...The image content is exactly as created in Scilab


3.: Exporting an image with size > monitorsize:
Same behaviour as before, that means, pixels are either added when
used with borders.
Pixels are not added when used without borders.
However, the resulting image does only show pixels which are visible
at the monitor when Scilab disdplays the figure.

Conclusion:
When one trys to screenshot a huge figure, one has to be a bit careful
that the scilab figure does not exceed the monitor size.


One test by accident:

=> figure was created, but with content that overlayed the figure...in
my case I copied the example from the help page, without exporting the
figure.
The export command I typed in afterwards by hand...so the console
overlayed the figure.....as a result the exported image showed the
scilab figure beeing overlayed by the console.

That all makes sense, because at the moment of the screenshot the
figure was indeed hidden behind the console.


Summary: All good so far.

BR
Philipp






2019-08-04 0:22 GMT+02:00, Samuel Gougeon <[hidden email]>:

> Le 03/08/2019 à 23:12, Samuel Gougeon a écrit :
>> Hello Philipp,
>>
>> Thanks for the feedback.
>> I still publish some 5.5.2 binaries because 5.5.2 is still rather used
>> (and for a while,
>> because it is the most stable version to date). So it's important that
>> it runs as expected.
>>
>> I confirm the issue. I can't understand what occurs. I never put
>> absolute paths anywhere in my code.
>
>
> ...But as an evidence, genlib() does !
> Very unexpected, ugly, and unseemly, to store local personal information
> in a compiled binary.
> By the way, what for?! One does not expect to have any issue if we move
> the directory of .bin.
>
> This occurs at least on 5.5.2. genlib() has changed in 6.0. I will have
> a look to the source code
> to see if this path recording is still implemented.
>
>
> The issue came from the fact, that in the .start script, the gui2bitmap
> library was loaded with load() instead of with lib().
> In 5.5.2, load() is able to work without complaining, but badly => error
> only at the first call of the library.
> In the other hand, lib() may have some reported issue in 6.0.
>
> Anyway, it is now fixed. I have uploaded the binary for 5.5, and it works.
> Since there is just one line different in the .start file, i won't
> create a new gui2bitmap sub-version for that.
> By the way, the uploaded sources are declared to be for 6.0.
>
> Please do not hesitate to confirm that this is now OK as well on your
> system.
>
> Best regards
> Samuel
>
>> The most puzzling is that, after your message, i just recompiled the
>> library, repushed to ATOMS
>> a -1 version of the binary. I have cleaned my local installation,
>> including the archive.
>> After atomsSystemUpdate(), now the version -1.bin is downloaded and
>> installed..
>> But the issue is still here! For the time being, i just remove the 5.5
>> release from ATOMS.
>> Either the issue is from my zipper (but i use the same for the 6.0
>> binary, and there is not
>> this issue...!), or from the ATOMS server (that knows the absolute
>> path when uploading
>> the zip. This is the only explanation i see for now... But still, why
>> only for 5.5.2?)
>>
>> Regards
>> Samuel
>>
>> Le 03/08/2019 à 22:03, P M a écrit :
>>> Hallo Samuel,
>>>
>>> I know...old system, but still....
>>>
>>> Win XP
>>> Scilab 5.5.2
>>> - Install gui2ibtmap from atoms.
>>>
>>>
>>> copy paste the first example into the console gives follwing
>>> ...
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>


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

There we have the salad.
_______________________________________________
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: gui2bitmap 1.0 is released

testing with:
- Win7
- Scilab 6.0.2
- Screen: 1600 x 1200 px

from gui2bitmap 1st example:
f.axes_size = [650 400];

1.: test with borders:
resulting image size: 666 x 459 px   // different from 5.5.2 version with 1280 x 1024 screen (658 x 448 px)

2.: test without borders
resulting image size: 650 x 400 px


Am So., 4. Aug. 2019 um 22:22 Uhr schrieb P M <[hidden email]>:
After updating Atoms it works now...thanks.

So here are some tests:

Screen: 1280 x 1024 px
Graphic Card: NVIDIA GeForce 210:
View images with IrfanView.

From the 1st example of gui2bitmap.
f.axes_size = [650 400];

1.:  Exporting the figure WITH borders: resulting image is 658 x 448 px
=> +8 px in width
=> + 48px in height
--> understandable, because the toolbar and borders are added to the figure

2.: Exporting the figure WITHOUT borders gives 650 x 400 px...
all OK...The image content is exactly as created in Scilab


3.: Exporting an image with size > monitorsize:
Same behaviour as before, that means, pixels are either added when
used with borders.
Pixels are not added when used without borders.
However, the resulting image does only show pixels which are visible
at the monitor when Scilab disdplays the figure.

Conclusion:
When one trys to screenshot a huge figure, one has to be a bit careful
that the scilab figure does not exceed the monitor size.


One test by accident:

=> figure was created, but with content that overlayed the figure...in
my case I copied the example from the help page, without exporting the
figure.
The export command I typed in afterwards by hand...so the console
overlayed the figure.....as a result the exported image showed the
scilab figure beeing overlayed by the console.

That all makes sense, because at the moment of the screenshot the
figure was indeed hidden behind the console.


Summary: All good so far.

BR
Philipp






2019-08-04 0:22 GMT+02:00, Samuel Gougeon <[hidden email]>:
> Le 03/08/2019 à 23:12, Samuel Gougeon a écrit :
>> Hello Philipp,
>>
>> Thanks for the feedback.
>> I still publish some 5.5.2 binaries because 5.5.2 is still rather used
>> (and for a while,
>> because it is the most stable version to date). So it's important that
>> it runs as expected.
>>
>> I confirm the issue. I can't understand what occurs. I never put
>> absolute paths anywhere in my code.
>
>
> ...But as an evidence, genlib() does !
> Very unexpected, ugly, and unseemly, to store local personal information
> in a compiled binary.
> By the way, what for?! One does not expect to have any issue if we move
> the directory of .bin.
>
> This occurs at least on 5.5.2. genlib() has changed in 6.0. I will have
> a look to the source code
> to see if this path recording is still implemented.
>
>
> The issue came from the fact, that in the .start script, the gui2bitmap
> library was loaded with load() instead of with lib().
> In 5.5.2, load() is able to work without complaining, but badly => error
> only at the first call of the library.
> In the other hand, lib() may have some reported issue in 6.0.
>
> Anyway, it is now fixed. I have uploaded the binary for 5.5, and it works.
> Since there is just one line different in the .start file, i won't
> create a new gui2bitmap sub-version for that.
> By the way, the uploaded sources are declared to be for 6.0.
>
> Please do not hesitate to confirm that this is now OK as well on your
> system.
>
> Best regards
> Samuel
>
>> The most puzzling is that, after your message, i just recompiled the
>> library, repushed to ATOMS
>> a -1 version of the binary. I have cleaned my local installation,
>> including the archive.
>> After atomsSystemUpdate(), now the version -1.bin is downloaded and
>> installed..
>> But the issue is still here! For the time being, i just remove the 5.5
>> release from ATOMS.
>> Either the issue is from my zipper (but i use the same for the 6.0
>> binary, and there is not
>> this issue...!), or from the ATOMS server (that knows the absolute
>> path when uploading
>> the zip. This is the only explanation i see for now... But still, why
>> only for 5.5.2?)
>>
>> Regards
>> Samuel
>>
>> Le 03/08/2019 à 22:03, P M a écrit :
>>> Hallo Samuel,
>>>
>>> I know...old system, but still....
>>>
>>> Win XP
>>> Scilab 5.5.2
>>> - Install gui2ibtmap from atoms.
>>>
>>>
>>> copy paste the first example into the console gives follwing
>>> ...
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>


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

There we have the salad.

_______________________________________________
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: gui2bitmap 1.0 is released

Le 05/08/2019 à 09:46, P M a écrit :

> testing with:
> - Win7
> - Scilab 6.0.2
> - Screen: 1600 x 1200 px
>
> from gui2bitmap 1st example:
> f.axes_size = [650 400];
>
> 1.: test with borders:
> resulting image size: 666 x 459 px   // different from 5.5.2 version
> with 1280 x 1024 screen (658 x 448 px)

Tnaks for this feedback.
The borders thickness and frame (and overall style) of windows depend on
the windows manager (and on the look&feel).
So these slight differences are not suprising. The main thing is that
the image should always be well "in/around the frame", without extra
margins nor shifts.


_______________________________________________
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: gui2bitmap 1.0 is released

In reply to this post by der_Phil
Le 04/08/2019 à 22:22, P M a écrit :
> ...
>
> 3.: Exporting an image with size > monitorsize:


Currently, gui2bitmat() is not built to handle this case. It's more
complex (but possible) to handle it in java.
I mainly wished to propose without more delay an easy solution to this
long standing issue.

But the case where the gui window is maximized is normally supported and
has been tested
It's a special case, because then some window borders are removed by the
window manager.

> One test by accident:
>
> => figure was created, but with content that overlayed the figure...in
> my case I copied the example from the help page, without exporting the
> figure.
> The export command I typed in afterwards by hand...so the console
> overlayed the figure.....as a result the exported image showed the
> scilab figure beeing overlayed by the console.

This should not occur, but it may, in the default without-border mode.
In this mode,
the height of the status bar must be determined, and the required
graphical tests
take a bit of time (1-5 s depending on the speed and load of the computer).
If in this meantime the gui gets on the back, yes we then get this effect.
This will be improved in the next version.

Samuel


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

[Scilab-users] gui2bitmap 1.1 is released

In reply to this post by der_Phil
gui2bitmap 1.1 is released.

CHANGES 1.0 => 1.1
==================
FIX and IMPROVEMENTS:

  1. On Windows, any graphical window that is partly shifted off-screen is now managed.
  2. On slow computers, sometimes the snapshot shew some overlaying window instead of the Graphical one.
  3. Loading the library was bugged with Scilab 5.5.2.
  4. In case of NWNI mode, the error message was wrong.

Philipp,

I hope the point 2) will now be ok on your side:

One test by accident:

=> figure was created, but with content that overlayed the figure...in
my case I copied the example from the help page, without exporting the
figure.
The export command I typed in afterwards by hand...so the console
overlayed the figure.....as a result the exported image showed the
scilab figure beeing overlayed by the console.

You may also test the point 1).
Both points are quite sensitive to graphics speed, that depends on the Scilab version, and on the computer.

Now i will work a bit on animaGIF() to make it using gui2bitmap() instead of xs2png().

Best regards
Samuel


Le 04/08/2019 à 22:22, P M a écrit :
After updating Atoms it works now...thanks.

So here are some tests:

Screen: 1280 x 1024 px
Graphic Card: NVIDIA GeForce 210:
View images with IrfanView.

From the 1st example of gui2bitmap.
f.axes_size = [650 400];

1.:  Exporting the figure WITH borders: resulting image is 658 x 448 px
=> +8 px in width
=> + 48px in height
--> understandable, because the toolbar and borders are added to the figure

2.: Exporting the figure WITHOUT borders gives 650 x 400 px...
all OK...The image content is exactly as created in Scilab


3.: Exporting an image with size > monitorsize:
Same behaviour as before, that means, pixels are either added when
used with borders.
Pixels are not added when used without borders.
However, the resulting image does only show pixels which are visible
at the monitor when Scilab disdplays the figure.

Conclusion:
When one trys to screenshot a huge figure, one has to be a bit careful
that the scilab figure does not exceed the monitor size.


One test by accident:

=> figure was created, but with content that overlayed the figure...in
my case I copied the example from the help page, without exporting the
figure.
The export command I typed in afterwards by hand...so the console
overlayed the figure.....as a result the exported image showed the
scilab figure beeing overlayed by the console.

That all makes sense, because at the moment of the screenshot the
figure was indeed hidden behind the console.


Summary: All good so far.

BR
Philipp


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

[Scilab-users] gui2bitmap 1.2 is released

In reply to this post by Samuel GOUGEON

This release should answer to display-scaling issues encountered by Ted & Philipp.

Regards
Samuel

https://atoms.scilab.org/toolboxes/gui2bitmap

CHANGES 1.1 => 1.2
==================
* "setMenu", "setScale" and "setBorders" syntaxes added.
* gui2bitmap() now works as well on Linux (and MacOS X: not tested)
* Unit tests added.
* Tested on Windows 7 1920x1080 (with scale = 100|125|150%), 1600x900, 1280x720
* Tested on Linux Fedora 24


SYNTAXES
--------
gui2bitmap(idFig, filename)
gui2bitmap(idFig, filename, withBorders)

gui2bitmap("setMenu", parentHandle)

gui2bitmap("setBorders", borders)
gui2bitmap("setScale", scale)

with:

idFig      : handle of the figure
filename   : pathname to the output image file
withBorders: boolean
borders    : vector of 3 booleans
             [left_border, bottom_border, right_border]
scale      : Screen display zoom factor, in percentage


Le 02/08/2019 à 14:29, Samuel Gougeon a écrit :

Hello,

I am glad to announce the first release of the gui2bitmat package :
https://atoms.scilab.org/toolboxes/gui2bitmap

gui2bitmap() aims to export into a .png | .jpg | .gif | .bmp bitmap image
any graphical figure or User Interface with interactive components (uicontrols).
An option allows to get the image of the full window, including its
border/frame (with its menus bar, tools bar, status bar, and other bars ;-)

It is a stand-alone function (no thirdparty needed), easy to use and easy to maintain
(no hard code to recompile from a Scilab version to next ones).

It is tested on Windows, but it should run as well on Linux and MacOS.
It is fully documented.

Enjoy.
Samuel

-----------------------

gui2bitmap

get a bitmap image of a graphical figure or interface, including its uicontrols, nay window borders

SYNTAXES
--------
gui2bitmap(idFig, filename)
gui2bitmap(idFig, filename, withBorders)

idFig      : handle of the figure
filename   : pathname to the output image file
withBorders: boolean



_______________________________________________
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: gui2bitmap 1.2 is released

Hi Samuel,

I confirm:
- test with Win10 Laptop
- screen resolution 1920 x 1080 px
- screen scale factor 100 & 125%

using:
gui2bitmap("setScale", 100);  // 125 respectively
gui2bitmap("setBorders", [%F %F %F]); gui2bitmap(f, pathName, %t) // with no borders left, bottom, right
results in a correct screen shot image.

Thanks, great work.
Philipp

Am Fr., 9. Aug. 2019 um 04:53 Uhr schrieb Samuel Gougeon <[hidden email]>:

This release should answer to display-scaling issues encountered by Ted & Philipp.

Regards
Samuel

https://atoms.scilab.org/toolboxes/gui2bitmap

CHANGES 1.1 => 1.2
==================
* "setMenu", "setScale" and "setBorders" syntaxes added.
* gui2bitmap() now works as well on Linux (and MacOS X: not tested)
* Unit tests added.
* Tested on Windows 7 1920x1080 (with scale = 100|125|150%), 1600x900, 1280x720
* Tested on Linux Fedora 24


SYNTAXES
--------
gui2bitmap(idFig, filename)
gui2bitmap(idFig, filename, withBorders)

gui2bitmap("setMenu", parentHandle)

gui2bitmap("setBorders", borders)
gui2bitmap("setScale", scale)

with:

idFig      : handle of the figure
filename   : pathname to the output image file
withBorders: boolean
borders    : vector of 3 booleans
             [left_border, bottom_border, right_border]
scale      : Screen display zoom factor, in percentage


Le 02/08/2019 à 14:29, Samuel Gougeon a écrit :

Hello,

I am glad to announce the first release of the gui2bitmat package :
https://atoms.scilab.org/toolboxes/gui2bitmap

gui2bitmap() aims to export into a .png | .jpg | .gif | .bmp bitmap image
any graphical figure or User Interface with interactive components (uicontrols).
An option allows to get the image of the full window, including its
border/frame (with its menus bar, tools bar, status bar, and other bars ;-)

It is a stand-alone function (no thirdparty needed), easy to use and easy to maintain
(no hard code to recompile from a Scilab version to next ones).

It is tested on Windows, but it should run as well on Linux and MacOS.
It is fully documented.

Enjoy.
Samuel

-----------------------

gui2bitmap

get a bitmap image of a graphical figure or interface, including its uicontrols, nay window borders

SYNTAXES
--------
gui2bitmap(idFig, filename)
gui2bitmap(idFig, filename, withBorders)

idFig      : handle of the figure
filename   : pathname to the output image file
withBorders: boolean


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

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

Re: gui2bitmap 1.0 is released

In reply to this post by Samuel GOUGEON
Philipp,

Thanks for your effort with this issue.

For clarity:
via atoms: unistall gui2bitmap
//atomsRemove('gui2btmap')

close Scilab
open scilab

via atoms: update repository
//atomsSystemUpdate()

via atoms: install gui2bitmap
//atomsInstall('gui2bitmap')

close scilab
open scilab

in console: help gui2bitmap

result: help page of gui2bitmap appears

Artifacts that remain:
1. When gui2bitmap is executed the GUI screen grows 1/4"
to the right and to the bottom.

2. The saved screen capture and the printed screen image both
contain slight images of the background.
About 1mm on the left and right borders and about 1.5mm
at the bottom border.

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: gui2bitmap 1.0 is released

In reply to this post by Samuel GOUGEON
Samuel,
Observations:
The Windows 10 Snipping Tool has a window mode that accurately captures the
selected window.

Additionally, if you hold down the Alt key when you press the Print Screen
key the window
that has focus is captured.
Therefore, there must be a Windows command to capture the window that has
focus.
This command might be available to execute from the gui2bitmap code.


Found this information regarding the window command:

WIN32 API
GetActiveWindow will return the top-level window that is associated
with the input focus. GetFocus will return the handle of the window
that has the input focus.

This article might help:
http://www.microsoft.com/msj/0397/Win32/Win320397.aspx

Hope this helps.
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
Perrichon Pierre Perrichon Pierre
Reply | Threaded
Open this post in threaded view
|

Re: gui2bitmap 1.0 is released

1000 messages. I don"t understand that sreen captures need to be in the
whole world, if this is correctly done with a sabnshoop of windows.
Could Scilab team improves palette on Xcos. Here is a real question, and
certainlny not Gougeon pixel routines .

Keep serious please


Before printing, think about ENVIRONMENTAL responsabity

-----Message d'origine-----
De : users <[hidden email]> De la part de VTX1801
Envoyé : mardi 13 août 2019 21:09
À : [hidden email]
Objet : Re: [Scilab-users] gui2bitmap 1.0 is released

Samuel,
Observations:
The Windows 10 Snipping Tool has a window mode that accurately captures the
selected window.

Additionally, if you hold down the Alt key when you press the Print Screen
key the window that has focus is captured.
Therefore, there must be a Windows command to capture the window that has
focus.
This command might be available to execute from the gui2bitmap code.


Found this information regarding the window command:

WIN32 API
GetActiveWindow will return the top-level window that is associated
with the input focus. GetFocus will return the handle of the window
that has the input focus.

This article might help:
http://www.microsoft.com/msj/0397/Win32/Win320397.aspx

Hope this helps.
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
Perrichon Pierre Perrichon Pierre
Reply | Threaded
Open this post in threaded view
|

Re: gui2bitmap 1.0 is released

In reply to this post by VTX1801
Samuel Gougeon,
This is a very bad road, also change direction and move
Your soft doesn't correctly go on


Before printing, think about ENVIRONMENTAL responsabity

-----Message d'origine-----
De : Perrichon <[hidden email]>
Envoyé : mardi 13 août 2019 21:42
À : 'Users mailing list for Scilab' <[hidden email]>
Objet : RE: [Scilab-users] gui2bitmap 1.0 is released

1000 messages. I don"t understand that sreen captures need to be in the
whole world, if this is correctly done with a sabnshoop of windows.
Could Scilab team improves palette on Xcos. Here is a real question, and
certainlny not Gougeon pixel routines .

Keep serious please


Before printing, think about ENVIRONMENTAL responsabity

-----Message d'origine-----
De : users <[hidden email]> De la part de VTX1801 Envoyé :
mardi 13 août 2019 21:09 À : [hidden email] Objet : Re:
[Scilab-users] gui2bitmap 1.0 is released

Samuel,
Observations:
The Windows 10 Snipping Tool has a window mode that accurately captures the
selected window.

Additionally, if you hold down the Alt key when you press the Print Screen
key the window that has focus is captured.
Therefore, there must be a Windows command to capture the window that has
focus.
This command might be available to execute from the gui2bitmap code.


Found this information regarding the window command:

WIN32 API
GetActiveWindow will return the top-level window that is associated with the
input focus. GetFocus will return the handle of the window that has the
input focus.

This article might help:
http://www.microsoft.com/msj/0397/Win32/Win320397.aspx

Hope this helps.
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

PERRICHON Pierre.vcf (3K) Download Attachment
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: gui2bitmap 1.0 is released

In reply to this post by VTX1801
Ted,

if one is able to execute following commands from Scilab:
- GetActiveWindow
- GetFocus

What is the result?
- a window handle to the active window
- a handle to the window that has the keyboard focus

I am no hardcore programmer, but to my understanding still there was no screenshot taken.

So what still would be necessary:
Call win10 snipping tool from scilab in such a way that it performs the screenshot on the window that has the focus.

BR
Philipp




Am Di., 13. Aug. 2019 um 21:09 Uhr schrieb VTX1801 <[hidden email]>:
Samuel,
Observations:
The Windows 10 Snipping Tool has a window mode that accurately captures the
selected window.

Additionally, if you hold down the Alt key when you press the Print Screen
key the window
that has focus is captured.
Therefore, there must be a Windows command to capture the window that has
focus.
This command might be available to execute from the gui2bitmap code.


Found this information regarding the window command:

WIN32 API
GetActiveWindow will return the top-level window that is associated
with the input focus. GetFocus will return the handle of the window
that has the input focus.

This article might help:
http://www.microsoft.com/msj/0397/Win32/Win320397.aspx

Hope this helps.
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