OS/2, eCS & ArcaOS - Technical > Programming

rexx Screen Capture

<< < (2/2)

Martin Iturbide:
I'm not a REXX expert (non-expert in a lot of things :D) but on my side the example is working fine.

The example generated 2 .bmp files, one with the screenshot of the desktop and other with some kind of log.

It is an interesting library for developers. Thanks

Regards

Jan-Erik Lärka:
Hello,

for those of you that would like to get a hint...


* Unpack the .zip-file somewhere, e.g. C:\Desktop\rxImgSize
* Open a program or folder that contain the title text "rxImgSize" ¹ (e.g. Folder or Archive manager with .zip-file open) and another window that contain the text "Editor" ¹ (e.g. Text Editor).
* Start a command prompt and run the script "rxtestimgsze"
*
* C:\DESKTOP\rxImgSize                                     Show current directory
* C:\DESKTOP\rxImgSize                                     Show current directory
* [C:\DESKTOP\rxImgSize]MKDIR IMAGES           Create a subfolder named IMAGES
* >rxImgSize: version 1.02, GBM: version 1.12<  Show version information about the library itself and GBM
* >1.02<                                                                Show only information about the library itself
* >1.12<                                                                Show only information about the GBM library
* 0                                                                         Capture² window that contain the title text "rximgsize" and save as example0.bmp in the folder images
* 338 243 24                                                         Show size and color depth for saved image (width height bpp)
* 0                                                                         Resize example0.bmp to 100 pixels wide (keep aspect) and save the result as example1.jpg in the folder images
* 0                                                                         Resize example0.bmp to 120 pixels wide (keep aspect) and save the result as example1.bmp in the folder images
* 0                                                                         Resize example0.bmp to 120x120 pixels and save the result as example2.bmp in the folder images
* 0                                                                         Resize example0.bmp to 120 pixels high and save the result as example3.bmp in the folder images
* 0                                                                         Resize example3.bmp to 137 pixels high and replace example3.bmp in the folder images
* 0                                                                         Read example0.bmp and save it as example4.bmp in the folder images
* 0                                                                         Resize example4.bmp to 210 pixels wide and replace it
* 0                                                                         Read and do quality scale (Lanczos) of example1.bmp to 1000x1000 pixels and save it as example5.bmp
* 0                                                                         Read and do quality scale (Nearestneighbor) of example3.bmp to 2000x2000 pixels and save it as example6.bmp
* 0                                                                         Read and do quality scale (Lanczos) of example0.bmp to 3000x3000 pixels and save it as example7.bmp
* 0                                                                         Capture² the desktop and save as example.bmp in the folder images
* 0                                                                         Capture² interior of window that contain the title text "editor" and save as example8.bmp in the folder images
* [C:\DESKTOP\rxImgSize]
You should see several rows with 0 (zero) if it is successful ³.
The capture procedure search for window names that match exactly (though caseless comparison) at first, but if it can't find any match look for windows that contain the text.

¹) or "RXIMGSIZE" or "rximgsize" or any variation to it as capitalization doesn't matter
²) the capture procedure will return "RXIMGSIZE not found." if there is no window with that name
³) info/resize/scale etc. will fail with a number depending on the cause. 0 = OK, 2 = missing image/file, etc. See source code for specific reasons.

//Jan-Erik

Jan-Erik Lärka:
Hello,

I've completed the rewrite of the library ( RxImgSze 1.03 ) to capture the screen and/or parts of it and save as an image (jpg, png, bmp etc.).
The library can also scale images and reduce/increase the number of colors of images of various file formats (jpg, png, gif, bmp etc.).
See the included hlp-file for information how to use the rexx library.
____
The script html2hlp interpret a html file to create a help file. ( Basic HTML 3.2 and HTML 4.0 )
See the example HTML file and "readme"
____
The included debug application help you debug libraries (.dll) for rexx
See "readme" for information

//Jan-Erik

Documentation corrected May 18, 2014, 10:10 CET

Martin Iturbide:
Thanks Jan-Erik.

I'm uploading it to hobbes.

Jan-Erik Lärka:
Hello,

was just reading how to do it .

Thank you for helping me out! :-)

Navigation

[0] Message Index

[*] Previous page

Go to full version