Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 01 JAN 2024 09:19:13AM Karl Pozmann wrote:

Is there a way to grab a screenshot of the active OI window programmatically?

k


At 01 JAN 2024 09:38AM Andrew McAuley wrote:

Is there a way to grab a screenshot of the active OI window programmatically?

k

I am away from my computer, but try grabbing the BITMAP property of the current window…

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 01 JAN 2024 10:47AM Karl Pozmann wrote:

Not being sure what do with the bitmap I tried this:

Image = Get_Property(@Window,"BITMAP")

Void = Exec_Method("CLIPBOARD","SETDATA","CF_BITMAP",Image)

To no avail…..

I also tried "CF_DIB" with no luck as well….


At 01 JAN 2024 01:01PM Donald Bakke wrote:

Is there a way to grab a screenshot of the active OI window programmatically?

If there is a native solution for this then I'm unaware of it. I am curious to see if Andrew's idea works. If you cannot get this to work, there is always this solution. Feel free to contact me offline if you want more inforamtion, but everything you need is available from that link.

Don Bakke

SRP Computer Solutions, Inc.


At 01 JAN 2024 02:29PM Carl Pates wrote:

At 01 JAN 2024 04:35PM Karl Pozmann wrote:

Interesting!

So when I try it, I get MOST of the data and NONE of the labels except for what's on a tab control. The text on a button is also missing.

The form is 8 pages, with the key and two editlines at the top on "All Pages", followed by a tab control with each page's data below that tab control. The first editline at the top shows up but not the second. Nor does the key.

I tried with both a png and jpg with the same results. Finally, I changed the "Behavior" and "Advanced" properties to "False" which had no impact. The status returned was "1". I also tried hiding the BMP_SCREENSHOT control. Here is the code:

      Void = Exec_Method(@Window:".BMP_SCREENSHOT","CAPTUREIMAGE","DRUG_PRODUCT")
      Filename = "K:\Screenshots\DP.jpg"
      Status = Exec_Method(@Window:".BMP_SCREENSHOT.IMAGE","SAVETOFILE",Filename)
      Void   = Msg(@Window,'Status = "':Status:'"')

I am running on a Windows 11 Pro 22H2 on Azure fwiw

Also, is there a way to place the image on the clipboard?

Thanks

Karl


At 01 JAN 2024 08:01PM Gerry Van Niekerk wrote:

Karl,

Just tried it with same controls as yours and yes it doesn't work.

My other forms work ok as I use it for Creating Help files.

Maybe an OI Issue?

Gerry


At 02 JAN 2024 07:28AM Karl Pozmann wrote:

Thanks for checking Gerry.

The only other thing I could think of is that maybe other properties of the IMAGE sub-object need to be addressed? Just looking at this code copied from EXAMPLES PRODUCTS and modified:

call set_property_Only ( bmp_CtrlEntID : ".IMAGE", "FILENAMES", valImageInfo<1> )

call set_Property_Only ( bmp_CtrlEntID : ".IMAGE", "COLORKEY", valImageInfo<5> ) call set_Property_Only ( bmp_CtrlEntID : ".IMAGE", "COUNT", valImageInfo<3> )


At 02 JAN 2024 07:52AM Carl Pates wrote:

HI Karl,

It's not an issue with the IMAGE object properties - it's to do with how some controls are processing the WM_PRINTCLIENT message. Can you send me a simple RDK of a form that duplicates your issue so I can run it under debug conditions and see what happens (email is below)

Saving directly to the clipboard would need a new IMAGE object method adding which I will add for v10.3 as it shares code with the upcoming Drag and Drop functionality, also targeted for a 10.3 release.

Regards

Carl Pates

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/1acab2671567a843b270837395fe57a3.txt
  • Last modified: 2025/05/29 20:25
  • by 127.0.0.1