Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jan-Erik Lärka

Pages: 1 2 [3] 4 5 ... 13
31
Programming / Re: Capture window that extend beyond the active desktop
« on: August 20, 2018, 07:44:33 pm »
Here's the updated version.
It can load images or movies and create multiple images if they extend beyond the desktop.
Placed in the folder "STITCH" (%HOME%\.cache\ContactSheet)
Would be nice if you that try it would addcapability to the library rxImgSze to either grab the window directly or to stitch the images into one.

Regards,
Jan-Erik Lärka

32
Programming / Re: Capture window that extend beyond the active desktop
« on: August 13, 2018, 07:33:10 pm »
But you did try what I suggested?

My application MCS can of course move around the viewport (window) on the current desktop to display the portions that extend over the edge, but the big problem then remain, to stitch all those parts together into one image.

Would you please help me write the code to merge multiple captured images together and exclude black areas?

33
Programming / Re: Capture window that extend beyond the active desktop
« on: August 12, 2018, 08:34:18 pm »
I do not know the answer to your question, other than to guess it will need to be something like what PMView implemented.
Latest Gotcha release, has the black bar for parts of the window off screen.
Yes, verified it too.
PMCamera cuts the window off at the screen border without any black bar filling where the rest of the window was at offscreen.
PMView, as you stated, captures the entire window, including the offscreen portion - I don't know how they are accomplishing it.
Enlarge your Firefox/Seamonkey window over 2 or more XPager pages, the more the better.
Enable screen capture of program window in PMView and activate it.
Here it flip around and trigger all pages in sequence that the window span over.

is the current Active XPager view present in OS2.INI, OS2SYS.INI or somewhere else so that one can query it, change the value and post a message to xwpdeamon to switch page?
The problem then is to stitch all those image pieces together.  :(

34
Programming / Re: Capture window that extend beyond the active desktop
« on: August 12, 2018, 01:17:22 pm »
Executable to try

Prerequisites
https://github.com/OS2World/LIB-REXX-RxImgSize
and Chris Wolgemuth's DrCtrl 0.1.7 and ffmpeg

35
Programming / Re: Capture window that extend beyond the active desktop
« on: August 11, 2018, 11:20:51 pm »
The parts that show on screen can bee seen while the other parts stay black.

36
Programming / Re: Capture window that extend beyond the active desktop
« on: August 11, 2018, 11:18:57 pm »
My screen resolution is only 1366x768 on this laptop.
The application detach the viewport and place it at coordinate 0,0 (lower left corner of the desktop) and with the width and height needed.
It take the snapshot and then restore the size and position of the viewport (See 1_orion_1.mpg.png to 3_orion_1.mpg.png for the viewport).

Image/Window size (1 and 2 was switched below and referred to each other, now corrected)

¹) The selected "DropShadow" background in the Example image use 204x156 pixels
The text at the top use 100 pixels and margins add 10 pixels.
See 2_orion_1.mpg.png and the corresponding MCS2.png
width = 10 + 5 × 204 = 1030              ( OK since 1030 < 1366 & 734 < 768 )
height = 10 + 100 + 4 × 156 = 734
See 1_orion_1.mpg.png and the corresponding MCS1.png

²) Each of the 20 images use 320x240 pixels by default without a background "frame".
The text at the top use 100 pixels and margins add 10 pixels.
width = 10 + 5 × 320 = 1610              ( Not OK since 1366 < 1610 & 768 < 1070 )
height = 10 + 100 + 4 × 240 = 1070
See 2_orion_1.mpg.png and the corresponding MCS2.png

³) But another background image can dictate that each frame (with spacing) should be larger and thus extend even further (400×280 pixels)
The text at the top use 100 pixels and margins add 52 pixels.
See 3_orion_1.mpg.png and the corresponding MCS3.png

37
Programming / Re: Capture window that extend beyond the active desktop
« on: August 11, 2018, 05:16:46 pm »
Example

38
Programming / Capture window that extend beyond the active desktop
« on: August 11, 2018, 08:50:30 am »
Hello,

I've written a .dll to capture and resize images and it work as expected.
I've now created an application that use it, and I consider it finished, but it can draw a window that is larger than the screen/desktop.
The problem is that parts of the window that extend beyond the edge of the desktop doesn't get filled with what the window contain, just a black background.
PMView seem to have a solution for it... to flip between the XPager pages that the window extend to, to capture and assemble the parts.
Isn't there a neater solution?
How can it be done either way?

Jan-Erik

39
Programming / Re: JSon to Rexx (stem)
« on: February 10, 2018, 10:43:07 pm »
New and improved :)
Tested on json from https://glosbe.com/ as well as openweather.

Code: [Select]
/*
 * Filename: fromJSon.cmd
 *   Author: JANERIK
 *  Created: Sat Feb  3 2018
 *  Purpose:
 *  Changes:
 */

IF ARG() > 0 THEN
    IF STREAM( ARG(1), 'C', 'QUERY EXISTS' ) <> '' THEN
        f_name = ARG(1)
    ELSE
        f_name = 'london.json'
ELSE
    f_name = 'london.json'

IF STREAM( f_name, 'C', 'QUERY EXISTS' ) = '' THEN RETURN 1
f_size = STREAM( f_name, 'C', 'QUERY SIZE' )
f_input = CHARIN( f_name, 1, f_size )
CALL STREAM f_name, 'C', 'CLOSE'
!_arrays_! = 'json.'
DO WHILE 0 < RxFromJSon( f_input )
    CALL CHAROUT 'STDERR', 'Parts of the file missing! Press Enter to read it again. '
    PARSE PULL
    f_size = STREAM( f_name, 'C', 'QUERY SIZE' )
    f_input = CHARIN( f_name, 1, f_size )
    CALL STREAM f_name, 'C', 'CLOSE'
END
SAY 'Press <Enter> to show JSON as flat Stem'
PARSE PULL
DO i = 1 TO json.!.0
   SAY json'.!.'i' -> 'json.!.i' => 'VALUE( json.!.i )
END
SAY 'Press <Enter> to show JSON Tree View Stem'
PARSE PULL
CALL RxRecursive 'json'
RETURN 0

RxRecursive: PROCEDURE EXPOSE (!_arrays_!) stem
   stm = ARG(1)
   DO i = 1 TO VALUE( stm'.0' )
      IF SYMBOL( VALUE( stm'.i' ) ) = 'VAR' THEN
         SAY stm'.'i' -> 'VALUE( stm'.i' )' => 'VALUE( VALUE( stm'.i' ) )
      IF DATATYPE( VALUE( stm'.i.0' ), 'W' ) THEN
         CALL RxRecursive stm'.'i
   END
RETURN 0

RxFromJSon: PROCEDURE EXPOSE (!_arrays_!) stem
   IF SYMBOL( 'stem' ) = 'LIT' THEN
      !_stem_! = 'json'
   ELSE
      !_stem_! = STRIP( stem, 'T', '.' )
   IF SYMBOL( '!_arrays_!' ) = 'LIT' THEN
      !_arrays_! = !_stem_!'.'
   !_json_! = !_stem_!
   !_tree_! = !_stem_!
   !_str_! = STRIP( ARG(1) )
   !_delim_! = ',:'
   !_quote_! = '""""'||"''''"
   !_group_! = '[]{}'
   !__tag__! = !_quote_!||!_group_!||!_delim_!
   !_counter_! = 0
   DO FOREVER
      old_trace = TRACE( 'O' )
      !_next_! = 1
      !_stop_! = LENGTH( !_str_! )
      DO !_i_! = 1 TO LENGTH( !__tag__! )
         !_char_! = SUBSTR( !__tag__!, !_i_!, 1 )
         !_pos_!.!_i_! = POS( !_char_!, !_str_! )
         IF 8 < !_i_! THEN
         DO
            DO !_j_! = 1 TO 7 BY 2
               !_k_! = !_j_! + 1
               IF RxIsBetween( !_pos_!.!_j_!, !_pos_!.!_i_!, !_pos_!.!_k_! ) THEN
                  !_pos_!.!_i_! = POS( !_char_!, !_str_!, !_pos_!.!_k_! + 1 )
            END
         END
         ELSE
            !_pos_!.!_i_! = POS( !_char_!, !_str_!, !_next_! )
         
         IF !_i_! < 9 & 0 < !_pos_!.!_i_! THEN
         DO
            IF !_i_! % 2 = 0 THEN
               !_stop_! = MIN( !_stop_!, !_pos_!.!_i_! + 1 )
            !_next_! = !_pos_!.!_i_! + 1
         END
            ELSE !_next_! = 1
         !_sorted_!.!_i_! = !_pos_!.!_i_! !_char_!
      END
      DO !_i_! = 1 TO LENGTH( !__tag__! )
         DO !_j_! = !_i_! + 1 TO LENGTH( !__tag__! )
            IF SUBWORD( !_sorted_!.!_j_!, 1, 1 ) < SUBWORD( !_sorted_!.!_i_!, 1, 1 ) & 0 < SUBWORD( !_sorted_!.!_j_!, 1, 1 ) | 0 = SUBWORD( !_sorted_!.!_i_!, 1, 1 ) THEN
            DO
               !_temp_! = !_sorted_!.!_i_!
               !_sorted_!.!_i_! = !_sorted_!.!_j_!
               !_sorted_!.!_j_! = !_temp_!
            END
         END
         !_ord_!.!_i_! = SUBWORD( !_sorted_!.!_i_!, 1, 1 )
         IF 0 < !_ord_!.!_i_! THEN
            !_chr_!.!_i_! = SUBWORD( !_sorted_!.!_i_!, 2, 1 )
         ELSE
            !_chr_!.!_i_! = ''
      END
      !_i_! = 2
      CALL TRACE old_trace
      IF 0 < POS( !_chr_!.1, ',}]' ) THEN
      DO
         !_lpos_! = LASTPOS( '.', !_json_! ) - 1
         IF 0 < !_lpos_! THEN
            !_json_! = LEFT( !_json_!, !_lpos_! )
         !_lpos_! = LASTPOS( '.', !_tree_! ) - 1
         IF 0 < !_lpos_! THEN
            !_tree_! = LEFT( !_tree_!, !_lpos_! )
      END
      ELSE IF !_chr_!.3 = ':' THEN
      DO
         DROP result
         !_key_! = SUBSTR( !_str_!, !_ord_!.1 + LENGTH( !_chr_!.1 ), !_ord_!.2 + LENGTH( !_chr_!.2 ) - !_ord_!.1 - LENGTH( !_chr_!.1 ) - 1 )
         !_num_! = 3 + ( 0 < POS( !_chr_!.4, !_quote_! ) | SUBSTR( !_group_!, POS( !_chr_!.4, !_group_! ) + 1, 1 ) = !_chr_!.5 )
         !_num_2_! = !_num_! + 1
         !_val_! = STRIP( SUBSTR( !_str_!, !_ord_!.!_num_! + LENGTH( !_chr_!.!_num_! ), !_ord_!.!_num_2_! + LENGTH( !_chr_!.!_num_2_! ) - !_ord_!.!_num_! - LENGTH( !_chr_!.!_num_! ) - 1 ) )
         !_json_! = !_json_!'.'!_key_!
         IF 0 < LENGTH( !_val_! ) | 0 < POS( !_chr_!.4, !_quote_! ) THEN
         DO
            INTERPRET !_json_!' = "'!_val_!'"'
            !_counter_! = !_counter_! + 1
            CALL VALUE !_stem_!'.!.'!_counter_!, !_json_!
            CALL VALUE !_stem_!'.!.0', !_counter_!
            !_val_! = VALUE( !_tree_!'.0' )
            IF \DATATYPE( !_val_!, 'W' ) THEN
               !_val_! = 0
            !_val_! = !_val_! + 1
            CALL VALUE !_tree_!'.0', !_val_!
            !_tree_! = !_tree_!'.'!_val_!
            CALL VALUE !_tree_!, !_json_!
         END
         !_i_! = !_num_! + 1 + ( 0 < POS( !_chr_!.4, !_quote_! ) | SUBSTR( !_group_!, POS( !_chr_!.4, !_group_! ) + 1, 1 ) = !_chr_!.5 )
      END
      ELSE IF 0 < POS( !_chr_!.1, '{[' ) THEN
      DO
         IF !_chr_!.1 = '[' THEN
            !_val_! = 0
         ELSE
            !_val_! = VALUE( !_json_!'.0' )
         IF DATATYPE( !_val_!, 'W' ) THEN
         DO
            !_val_! = !_val_! + 1
            CALL VALUE !_json_!'.0', !_val_!
            !_json_! = !_json_!'.'!_val_!
            CALL VALUE !_tree_!'.0', !_val_!
            !_tree_! = !_tree_!'.'!_val_!
            CALL VALUE !_tree_!, !_json_!
         END
      END
      IF 0 < !_ord_!.!_i_! THEN
         !_str_! = SUBSTR( !_str_!, !_ord_!.!_i_! )
      ELSE LEAVE
   END
RETURN 0 < POS( '.', !_tree_! )
   
RxIsBetween: PROCEDURE
RETURN ARG(1) < ARG(2) & ARG(2) < ARG(3)

40
Setup & Installation / Re: How to - Install Fonts on OS/2
« on: January 08, 2018, 12:25:13 pm »
Ehm... Think I found the code with a prevoid version of freetype/2 then

41
Setup & Installation / Re: How to - Install Fonts on OS/2
« on: January 07, 2018, 09:34:21 am »
That one will require a reboot to make the font available, though.

Maybe I should add a function to RXUTILEX.DLL for registering fonts without a reboot... well, something for the wish list, perhaps. :)
I wouldn't mind if RXUTILEX.DLL would contain a function to register one or more fonts.
By the way, the script is a variation to the one Alex Taylor provide on his site.

42
Setup & Installation / Re: How to - Install Fonts on OS/2
« on: January 07, 2018, 12:53:59 am »
You can also try a REXX script that can add .ttf-files
This script can extract and add them from .zip-files and WarpIn Packages as well

43
Applications / PM app ClamDScan
« on: January 05, 2018, 07:52:37 pm »
It is mulithreaded* and use clamdscan to scan for various threats.

Use clamd on another machine if set up in the clamd.conf file.

Add it to Folder actions (XWP) and you can right click on a folder and scan the whole folder structure.

It tell you what file it has processed (percent and first number) and how many more files this and previous thread that has finished contain* and the total number of files to process in this folder/drive.

ETA: 5h is the Estimated Time of Arrival calculated on the number of files processed and the number of files left to process, not their sizes.

​You can also notice the subtle shine that pass over the progress bar. Add a copy of the DLL in the libpath so it can load and use the progress bar images.

It create a folder on the desktop called "Alert" with the files it find that contain
Malware Trojan Worm Downloader etc.
It attach the Icons it find based on the type name of the threat so one can design ones own icons and place them in the folder next to the executable.

It also add a comment to the file of what type of threat it has detected and set the association type to the same, thus somewhat reduce the ease to double-click-open the file.

*It use multi threading to speed up processing.
It first list files in the current folder and add those so it can start to scan almost right away (if the current folder doesn't contain many files). Then it hand over to up to 5 additional threads (if there are 5 or more sub folders present) to list the files there. As each thread finish, the progress bar and title bar information adjust itself to the information while it scan queued files.

44
Applications / Re: Updated Postgresql/2 builds
« on: January 01, 2018, 07:27:32 pm »
initdb in the 9.4 and 9.6 build doesn't behave like they do in 9.3:

selecting dynamic shared memory implementation ... sysv
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... postgres: could not look up effecti
ve user ID 0: No such file or directory
child process exited with exit code 1
initdb: removing data directory "D:/NLSTeam"

45
Programming / Re: htonl in REXX
« on: December 26, 2017, 10:53:15 am »
It's not true reverse, it's more reverse in group of 2.
But that is if one start with a number and use Hex to do the swap.

What do you use as input?

Pages: 1 2 [3] 4 5 ... 13