There are apparently no work-arounds for the failure of this version of the export snapshot on Windows 10/11

I've tried:
    -- method that does not work on Windows, but works on macOS with player hidden [A REQUIREMENT]
    put the rect of player "myPlayer" into tRect
    export snapshot from rect tRect of player "myPlayer" to tImage as PNG
    put tImage into img "myImage"

    -- trying alt method #1 [FAILS LIKE ABOVE]
    export snapshot from player "myPlayer" to tImage as PNG
    put tImage into img "myImage"

    -- trying alt method #2 [TAKES A SNAPSHOT OF THE WINDOWS SCREEN]
    put the rect of player "myPlayer" into tRect
    export snapshot from rect tRect to tImage as PNG
    put tImage into img "myImage"

    -- trying alt method #3 [WORKS ONLY IF VISIBLE ON SCREEN WITH NOTHING ON TOP (no overlapping windows)] This also fails (with an execution error) if the user has moved the window so the player is off-screen!
    put the rect of player "myPlayer" into tRect
    export snapshot from rect tRect of window (the windowID of this stack) to tImage as PNG
    put tImage into img "myImage"

As I need to grab multiple specific frames of video as a series of images behind the scenes for any analysis/report, I can not have the player visible while the user is running the analysis. Current the code hides the player controller. The player is on a non-visible stack and the video is associated with that hidden player. A loop then sets the currentTime of the player to various points based on clips provided by the researcher and takes an image of each frame that currentTime is set to.

This works on macOS and in some prior versions of LC and/or Windows, worked on Windows as well and now in LC 9.6.7 on WIn 10/11 it does not.



On 4/27/2022 6:21 PM, Paul Dupuis via use-livecode wrote:
I am executing the following 2 lines of code:

              export snapshot from rect tRect of player "mediaConvert" of stack "libHrAPI" to tImage as PNG
              put tImage into img "imageConvert" of stack "libHrAPI"

Prior to the export the player has a video load and has the currentTime set to a particular frame, and I can see in the stack that the player is showing the correct frame is visible.
I can also see that the image "imageConvert" is also visible, but empty

After the Export Snapshot is executed, it looks like tImage contains valid PNG data, although I can not tell if it is the correct image After the Put statement, the image "imageConvert" is set to a white rectangle with a little bit of the player border on the left and top. It is the same size as the player where as the empty image I started with was larger.

This is with LC 9.6.7 on Windows 10. This code works on macOS. Does anyone know if there is a known Windows bug with export a snapshot form a player and any work around?


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to