Platforms to show: All Mac Windows Linux Cross-Platform

ScreenshotRectMBS(left as Integer, top as Integer, width as Integer, height as Integer) as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Screenshot MBS Picture Plugin Yes Yes Yes Yes No
Function: Returns a picture of the screen rectangle in screen resolution.
Example:
// write picture of window to desktop
#if TargetMacOS then
const f = 1
#else
dim f as double = screen(0).ScaleFactor
#endif

dim p as Picture = ScreenshotRectMBS(self.left*F, self.top*F, self.Width*F, self.Height*F)
dim ff as FolderItem = SpecialFolder.Desktop.Child("test.jpg")

p.Save(ff, p.SaveAsJPEG)
Notes:
Improved in Version 3.2 to support multiple displays on Mac OS.

Plugin Version 10.4 adds Windows support.
Coordinates given in pixel on screen, so for High DPI on Windows, you need to multiply them before passing parameters.

Some examples using this global method:

Blog Entries

Xojo Developer Magazine

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Picture Plugin.

The biggest plugin in space...




Links
MBS Xojo PDF Plugins