Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5    Statistic  

Window.Screenshot

Creates screenshot from a window.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Window 5.4 Yes Yes No No Yes
MBS( "Window.Screenshot"; WindowRef { ; MarginLeft; MarginTop; MarginRight; MarginBottom; ImageType; Filename } )   More

Parameters

Parameter Description Example value
WindowRef Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. 0
MarginLeft Optional
The margin from left to cut away border.
0
MarginTop Optional
The margin from top to cut away border.
0
MarginRight Optional
The margin from right to cut away border.
0
MarginBottom Optional
The margin from bottom to cut away border.
0
ImageType Optional
The type of image to return. Either JPEG, PNG, GIF or BMP. Default is JPEG.
"JPEG"
Filename Optional
The filename to use for the picture. Default is "image" with the extension matching the image type.
"test.jpg"

Result

Returns image or error.

Description

Creates screenshot from a window.
Margins are different for Mac and Windows.

Added iOS support in version 8.5, but margins are not supported there, so we always take full screen.

Examples

Creates screenshot:

MBS("Window.Screenshot"; Get(WindowName); Window Screenshot::Margin Left; Window Screenshot::Margin Top; Window Screenshot::Margin Right; Window Screenshot::Margin Bottom)

Screenshot of current window as JPEG:

MBS( "Window.Screenshot"; 0)

See also

Example Databases

Created 27th October 2015, last changed 29th October 2018


Window.RunToolbarCustomizationPalette   -   Window.Scrollbar.GetScrollElasticity

Feedback: Report problem or ask question.




Links
MBS Xojo blog