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 20 FEB 2006 03:56:10AM Brian Scarth wrote:

Has anyone managed to do a screen grab from within an OI procedure and save it as eg. a bitmap.

I've found various examples of VB programs doing this using Windows API OleCreatePictureIndirect in OLEPRO32.DLL but I've not managed to use this from within an OI procedure.

Regards

Brian


At 20 FEB 2006 03:11PM Pascal Landry wrote:

Myself, I'll just use Alt-PrintScreen and crop the image to remove the MDIframe. Easily done within MS Word.


At 21 FEB 2006 03:03AM dbakke@srpcs.com's Don Bakke wrote:

Pascal,

I think Brian is asking if OpenInsight can do this as a part of the application's functionality.

Brian,

We have not tried this using direct calls from OpenInsight. We have done something similar with one our ActiveX controls that is running on an OI window. Have you been unsuccessful using OleCreatePictureIndirect or do you not know how to make Win API calls from within OI?

dbakke@srpcs.com

SRP Computer Solutions, Inc.


At 22 FEB 2006 05:04AM Brian Scarth wrote:

Don,

I have to admit to only having a little experience of making WinAPI calls from within OI, but in this case I tried without success.

The VB definition for OleCreatePictureIndirect is as follows:

Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long

PicBMP is defined as:

lSize As Long
lType As Long
lhBMP As Long
lhPal As Long
lReserved As Long

GUID is defined as follows:

lData1 As Long
lData2 As Integer
lData3 As Integer
abData4(7) As Byte

I defined the above as "LPCHAR" in the dll template and the debugger shows them populated correctly, with the exception of "lhBMP".

"lhBMP" is returned from a SelectObject WinAPI call as, for example, 1610941652 but requires converting to binary to pass to OleCreatePictureIndirect as part of the RefIID parameter. I had expected "lhBmp=OConv(lhWndBmp,'VB')" to do this but the debugger shows otherwise, remaining as \31363130393431363532\. My own attempts at converting to binary only met with limited success as when the number is negative and converts to, for example, \FF…..\, OI treats the \FF\ as a row mark.

If all else fails I can write the routine in VB, but am always reluctant to do this.

Regards

Brian Scarth


At 23 FEB 2006 06:19AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Brian,

As a rule I'd stay away from calling the OLE DLL functions directly - they tend to work with interface pointers to COM objects which don't work too well with OI (as opposed to using OLE automation objects directly in Basic+, but that's another story :) - You're into the realms of pointers to pointers and while you might get away with it for some functions you'll be up against a brick wall for others.

In most cases I'd be more tempted to look for a C example rather than VB - There are other ways to acheive what you want - Using a combination of Windows GDI calls and some of the image manipulation functions in the ImageMan DLL supplied with OI for instance…

Anyway, having said that you ought to look at the OI define_struct, struct_to_var, var_to_struct and related functions when working with structures in OI. These will handle the OI-]binary conversion issues for you. The VB conversion does not do this - All it does is swap system delimiter chars to a binary sequence so they can be stored with a dynamic array without corrupting it's structure.

We'd be happy to help you more with this off line but we feel this is heading into the realms of consultancy as it relates directly to the use of the Windows API rather than an OpenInsight "support issue"…

The Sprezzatura Group

World leaders in all things RevSoft


At 23 FEB 2006 12:38PM Jim Vaughan wrote:

I have been using this…

http://www.techsmith.com/snagit.asp

…since the OS2 days.


At 23 FEB 2006 12:56PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

What is the API for calling it from within an OI procedure - can't find this on their website?

The Sprezzatura Group

World leaders in all things RevSoft


At 24 FEB 2006 12:38PM Jim Vaughan wrote:

Can I control SnagIt from another application?

	Answer

SnagIt can be controlled by another application in three ways:

1. SnagIt is a COM server and may be controlled by any application that supports COM. See the SnagIt COM Server pages for details on using the COM interface that is build into SnagIt. http://www.techsmith.com/snagit/accessories/comserver.asp

2. SnagIt is a DDE server and may be controlled by a DDE client app. See the SnagIt DDE Server pages for details on using the DDE interface.

http://www.techsmith.com/snagit/accessories/comserver.asp

3. SnagIt has a simple command line interface. A search of the SnagIt online help for "command" reveals:

/h - Hides the SnagIt window at startup.

/n - Disables keyboard input to SnagIt (For use with DDE applications.)

/i - Starts SnagIt as a minimized icon.

/S - Causes SnagIt to perform a capture using current settings and exit when finished or canceled. This option runs SnagIt hidden with hotkeys disabled.

/SC - Causes SnagIt to perform a capture using current settings and continue to run after the capture (not exit). This option runs SnagIt hidden with hotkeys disabled.

/t - Starts SnagIt with the system tray icon disabled (Windows 95/98 and Windows NT 4.0+).


At 25 FEB 2006 09:45AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Cool thanks! (RTFM ;))

The Sprezzatura Group

World leaders in all things RevSoft

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/012243773987058c8525711b00311692.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1