Screenshots with the CAPTUREIMAGE method

Published 21 JUN 2021 at 02:35:31PM

Bitmap controls in OpenInsight 10 have a method called CAPTUREIMAGE, which allows you to "screenshot" the contents of another OI control or form into the Bitmap control's IMAGE sub-object. As you can see, it has a very simple interface:

SuccessFlag = Exec_Method( BitMapCtrlID, "CAPTUREIMAGE", CaptureID )

Where "CaptureID" is the fully qualified name of the control to screenshot.

E.g.

If we have a form called TEST_CAPTUREIMAGE, with a BITMAP control called BMP_SCREENSHOT, then we can screenshot the contents of the IDE into it like so:

Call Exec_Method( "TEST_CAPTUREIMAGE.BMP_SCREENSHOT", "CAPTUREIMAGE", |
                   "RTI_IDE" )

(N.B. The captured image you see displayed above is scaled - the screenshot is stored at full resolution in the control itself)

One obvious use for this is for support purposes, e.g:

  • Take a screen-shot with CAPTUREIMAGE.
  • Use The SAVETOFILE method in the IMAGE API to save it to a file.
  • Create an email message with the image file attached or embedded and send it to your support desk.

We're sure you can think of more.

  • CAPTUREIMAGE works with any object that supports the Windows WM_PRINTCLIENT message.
  • BITMAP controls are basically an alias for STATIC controls, so all STATIC controls support this method.

Comments

Original ID: revdevx.com/?p=3408
  • third_party_content/community/commentary/revdevx/19531.6079976852.txt
  • Last modified: 2024/01/29 20:23
  • by 127.0.0.1