Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3   10.4    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 Flags
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 The margin from left to cut away border. 0 Optional
MarginTop The margin from top to cut away border. 0 Optional
MarginRight The margin from right to cut away border. 0 Optional
MarginBottom The margin from bottom to cut away border. 0 Optional
ImageType The type of image to return. Either JPEG, PNG, GIF or BMP. Default is JPEG. "JPEG" Optional
Filename The filename to use for the picture.
Default is "image" with the extension matching the image type.
The image is not written to disk. This file name is just added to the container for later export.
"test.jpg" Optional

Result

Returns image or error.

Description

Creates screenshot from a window.
Returns the image as container value, so you can assign it to a container field or save to disk with Container.WriteFile function.
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.

On Windows may get wrong rectangle if Windows runs desktop with 200% resolution, but you have a 100% resolution 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

Blog Entries

Release notes

Created 27th October 2015, last changed 2nd December 2019


Window.RunToolbarCustomizationPalette   -   Window.Scrollbar.GetScrollElasticity

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins