Platforms to show: All Mac Windows Linux Cross-Platform

CGDisplayMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A class for a CoreGraphics Display object.
Example
dim c as new CGDisplayMBS
dim lines(-1) as string

dim DPIWidth as Double = c.PixelsWide/(c.ScreenSizeWidth/10.0/2.54)
dim DPIHeight as Double = c.PixelsHigh/(c.ScreenSizeHeight/10.0/2.54)

lines.append str(c.ScreenSizeWidth)+" x "+str(c.ScreenSizeHeight)+" Millimeter with"
lines.Append str(c.PixelsWide)+" x "+str(c.PixelsHigh)+" Pixel is"
lines.Append str(DPIWidth)+" x "+str(DPIHeight)+" DPI"

MsgBox Join(lines,EndOfLine)

Capture option flags.

Constant Value Description
kCGCaptureNoFill 1 Disables fill with black on capture.
kCGCaptureNoOptions 0 Default behavior.

Keys for mode dictionary

Constant Value Description
kCGDisplayBitsPerPixel "BitsPerPixel" The number of bits per pixel.
The value for this key is a number inside the dictionary.
kCGDisplayBitsPerSample "BitsPerSample" The number of bits per sample.
The value for this key is a number inside the dictionary.
kCGDisplayBytesPerRow "kCGDisplayBytesPerRow"
kCGDisplayHeight "Height" The display height.
The value for this key is a number inside the dictionary.
kCGDisplayIOFlags "IOFlags" The value for this key is a number inside the dictionary.
kCGDisplayMode "Mode" The value for this key is a number inside the dictionary.
kCGDisplayModeIsInterlaced "kCGDisplayModeIsInterlaced" This key reflects interesting bits of the IOKit display mode flags.
kCGDisplayModeIsSafeForHardware "kCGDisplayModeIsSafeForHardware" Set if display mode doesn't need a confirmation dialog to be set.
kCGDisplayModeIsStretched "kCGDisplayModeIsStretched" This key reflects interesting bits of the IOKit display mode flags.
kCGDisplayModeIsTelevisionOutput "kCGDisplayModeIsTelevisionOutput" This key reflects interesting bits of the IOKit display mode flags.
kCGDisplayModeUsableForDesktopGUI "UsableForDesktopGUI" Whether this display can be used for desktop GUI.
The value for this key is a boolean inside the dictionary.
kCGDisplayRefreshRate "RefreshRate" The refresh rate.
The value for this key is a number inside the dictionary.
kCGDisplaySamplesPerPixel "SamplesPerPixel" The number of samples per pixel.
The value for this key is a number inside the dictionary.
kCGDisplayWidth "Width" The width of the display.
The value for this key is a number inside the dictionary.
kCGIODisplayModeID "IODisplayModeID"

Keys for options dictionary

Constant Value Description
kCGDisplayShowDuplicateLowResolutionModes "kCGDisplayResolution" Pass to AllDisplayModes with boolean to indicate whether to include duplicate low resolution modes.

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some examples using this class:

Blog Entries

Release notes

  • Version 21.5
    • Added kCGDisplayShowDuplicateLowResolutionModes constant for CGDisplayMBS class.

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


CGDisplayConfigMBS   -   CGDisplayModeMBS


The biggest plugin in space...