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.
// write picture of window to desktop
#if TargetMacOS then
const f = 1
dim f as double = screen(0).ScaleFactor

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

p.Save(ff, p.SaveAsJPEG)
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...

MBS Xojo PDF Plugins