Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGDisplayMBS class.

CGDisplayMBS.BeamPosition as UInt32

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the current beam position on the display.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.BeamPosition)

If display is invalid, or the display does not implement conventional video vertical and horizontal sweep in painting, or the driver does not implement this functionality, 0 is returned.
(Read only property)

CGDisplayMBS.Bounds as CGRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Return screen size and origin in global coords.

Empty rect or nil if display is invalid.
(Read only property)

CGDisplayMBS.Brightness as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 15.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Get/Set brightness of display.

Returns -1 if not supported.
Lasterror is set.
(Read and Write property)

CGDisplayMBS.CanSetPalette as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns true if the current display mode supports palettes.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.CanSetPalette)

(Read only property)

CGDisplayMBS.ColorSpace as CGColorSpaceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the color space for a display.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.ColorSpace.Model) // typical 1 = CGColorSpaceMBS.kCGColorSpaceModelRGB

This function returns a display-dependent ICC-based color space. You can use this function when rendering content for a specific display in order to produce color-matched output for that display.

Available in Mac OS X v10.5 and later.
(Read only property)

CGDisplayMBS.CurrentMode as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Return a Dictionary describing the current display mode.
Example
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim dic as Dictionary = d.CurrentMode

MsgBox dic.Value(d.kCGDisplayWidth)+" x "+dic.Value(d.kCGDisplayHeight)

Returns nil on any error.
(Read only property)

CGDisplayMBS.DisplayMode as CGDisplayModeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Return the current mode of the specified display.
Example
dim d as CGDisplayMBS = CGDisplayMBS.MainDisplay
MsgBox str(d.DisplayMode.Width)+" x "+str(d.DisplayMode.Height)

Returns nil on any error.
Requires Mac OS X 10.6
(Read only property)

CGDisplayMBS.DisplayProductNames as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 14.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries product names for display in all available languages.
Example
dim display as CGDisplayMBS = CGDisplayMBS.MainDisplay
dim names as Dictionary = display.DisplayProductNames

MsgBox names.Lookup("en_US", "?")

(Read only property)

CGDisplayMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The handle to the current display.

Internally: The DisplayID.
0 is the main display (to keep it easier).
(Read only property)

CGDisplayMBS.IOServicePort as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 11.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Return the IOKit service port of a display.

(Read only property)

CGDisplayMBS.IsActive as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is active.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsActive)

If true, the specified display is active; otherwise, false.

An active display is connected, awake, and available for drawing. In a hardware mirroring set, only the primary display is active.
(Read only property)

CGDisplayMBS.IsAlwaysInMirrorSet as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is always in a mirroring set.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsAlwaysInMirrorSet)

If true, the specified display is in a mirroring set and cannot be removed from this set.

Some hardware configurations support the connection of auxiliary displays that always mirror the main display, and therefore cannot be removed from the mirroring set to which they belong.
(Read only property)

CGDisplayMBS.IsAsleep as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is sleeping (and is therefore not drawable.)
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsAsleep)

If true, the specified display is in sleep mode; otherwise, false.

A display is sleeping when its frame buffer and the attached monitor are in reduced power mode. A sleeping display is still considered to be a part of global display (desktop) space, but it is not drawable.
(Read only property)

CGDisplayMBS.IsBuiltin as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is built-in, such as the internal display in portable systems.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsBuiltin)

If true, the specified display is considered to be a built-in display; otherwise, false.

Portable systems typically identify the internal LCD panel as a built-in display.

Note that it is possible and reasonable for a system to have no displays marked as built-in. For example, a portable system running with the lid closed may report no built-in displays.
(Read only property)

CGDisplayMBS.IsInHWMirrorSet as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is in a hardware mirroring set.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsInHWMirrorSet)

If true, the specified display is a member of a hardware mirroring set; otherwise, false.

When hardware mirroring is enabled, the contents of a double frame buffer are rendered in all displays in the hardware mirroring set.
(Read only property)

CGDisplayMBS.IsInMirrorSet as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is in a mirroring set.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsInMirrorSet)

(Read only property)

CGDisplayMBS.IsMain as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is the main display.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsMain)

If true, the specified display is currently the main display; otherwise, false.
(Read only property)

CGDisplayMBS.IsOnline as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is connected or online.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsOnline)

Returns true if the specified display is connected; otherwise, false.

A display is considered connected or online when the frame buffer hardware is connected to a monitor.

You can use this function to determine if someone has hot-plugged a display to the system. Note that hot-plugging is a hardware feature that may not be present on all displays.
(Read only property)

CGDisplayMBS.IsStereo as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether a display is running in a stereo graphics mode.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsStereo)

If true, the specified display is running in a stereo graphics mode; otherwise, false.

Available in Mac OS X v10.4 and later.
(Read only property)

CGDisplayMBS.LastError as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 15.4 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The last error code.

Only set for a few properties like brightness where we do have an error code.
(Read only property)

CGDisplayMBS.MirrorsDisplay as CGDisplayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
For a secondary display in a mirroring set, returns the primary display.

Returns the primary display in the mirroring set. Returns kCGNullDirectDisplay if the specified display is actually the primary display or is not in a mirroring set.
(Read only property)

CGDisplayMBS.ModelNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the model number of a display monitor.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.ModelNumber)

A model number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.

This function uses I/O Kit to identify the monitor associated with the specified display. The return value depends on the following:

If I/O Kit can identify the monitor, the product ID code for the monitor is returned.
If I/O Kit can't identify the monitor, kDisplayProductIDGeneric is returned.
If no monitor is connected, a value of 0xFFFFFFFF is returned.
(Read only property)

CGDisplayMBS.PixelsHigh as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Height of the display in pixels.

dim d as new CGDisplayMBS // pick main display

MsgBox str(D.PixelsHigh)
(Read only property)

CGDisplayMBS.PixelsWide as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Width of the display in pixels.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(D.PixelsWide)

(Read only property)

CGDisplayMBS.PrimaryDisplay as CGDisplayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the primary display in a hardware mirroring set.

The primary display in the mirror set. If display is not hardware-mirrored, this function simply returns display.

In hardware mirroring, the contents of a double frame buffer are rendered in two or more displays simultaneously. The mirrored displays are said to be in a hardware mirroring set.

At the discretion of the device driver, one of the displays in a hardware mirroring set is designated as the primary display. The device driver binds the drawing engine, hardware accelerator, and 3D engine to the primary display, and directs all drawing operations to this display.
(Read only property)

CGDisplayMBS.RefreshRate as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 15.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries refresh rate in Hz for this display.
Example
dim m as CGDisplayMBS = CGDisplayMBS.MainDisplay
MsgBox str(m.RefreshRate)+" Hz"

Returns 60 for LCD displays.
(Read only property)

CGDisplayMBS.Rotation as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the rotation angle of a display in degrees.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.Rotation)

The rotation angle of the display in degrees, or 0 if the display is not valid.

This function returns the rotation angle of a display in a clockwise direction. For example, if the specified display is rotated clockwise 90 degrees then this function returns 90.0. After a 90 degree clockwise rotation, the physical bottom of the display is on the left side and the physical top is on the right side.

Available in Mac OS X v10.5 and later.
(Read only property)

CGDisplayMBS.ScreenSizeHeight as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the height of a display in millimeters.
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)

If Extended Display Identification Data (EDID) for the display device is not available, the size is estimated based on the device width and height in pixels from CGDisplayBounds, with an assumed resolution of 2.835 pixels/mm or 72 DPI, a reasonable guess for displays predating EDID support.
(Read only property)

CGDisplayMBS.ScreenSizeWidth as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the width of a display in millimeters.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.ScreenSizeHeight) // for example 400 on a 30" Apple Display
MsgBox str(d.ScreenSizeWidth) // for example 640 on a 30" Apple Display

If Extended Display Identification Data (EDID) for the display device is not available, the size is estimated based on the device width and height in pixels from CGDisplayBounds, with an assumed resolution of 2.835 pixels/mm or 72 DPI, a reasonable guess for displays predating EDID support.
(Read only property)

CGDisplayMBS.SerialNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the serial number of a display monitor.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(D.SerialNumber)

Returns the serial number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.

This function uses I/O Kit to identify the monitor associated with the specified display.

If I/O Kit can identify the monitor:

If the manufacturer has encoded a serial number for the monitor, the number is returned.
If there is no encoded serial number, 0x00000000 is returned.

If I/O Kit cannot identify the monitor:

If a monitor is connected to the display, 0x00000000 is returned.
If no monitor is connected to the display hardware, a value of 0xFFFFFFFF is returned.

Note that a serial number is meaningful only in conjunction with a specific vendor and product or model.
(Read only property)

CGDisplayMBS.UnitNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the logical unit number of a display.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(D.UnitNumber)

A logical unit number for the specified display.

The logical unit number represents a particular node in the I/O Kit device tree associated with the display's frame buffer. For a particular hardware configuration, this value will not change when the attached monitor is changed.

The unit number will change if the I/O Kit device tree changes, as when hardware is reconfigured, drivers are replaced, or significant changes occur to I/O Kit, so it should not be assumed to be invariant across login sessions.

For more information about I/O Kit, see the Apple publication "I/O Kit Fundamentals".
(Read only property)

CGDisplayMBS.UsesOpenGLAcceleration as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a Boolean value indicating whether Quartz is using OpenGL-based window acceleration (Quartz Extreme) to render in a display.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(D.UsesOpenGLAcceleration)

Return value: If true, Quartz Extreme is used to render in the specified display; otherwise, false.

Quartz Extreme is an OpenGL-based, hardware-accelerated window compositor available in Mac OS X version 10.2 and later. Quartz Extreme requires a minimum hardware configuration to operate.

The information this function provides is typically used to adjust the demands of drawing operations to the capabilities of the display hardware. For example, an application running on an unaccelerated system could disable live window-resizing.
(Read only property)

CGDisplayMBS.VendorNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 8.6 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the vendor number of the specified display's monitor.
Example
dim d as new CGDisplayMBS // pick main display

MsgBox str(D.VendorNumber)
// 1552 seems to be Apple

A vendor number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.

This function uses I/O Kit to identify the monitor associated with the specified display.

There are three cases:

If I/O Kit can identify the monitor, the vendor ID is returned.
If I/O Kit cannot identify the monitor, kDisplayVendorIDUnknown is returned.
If there is no monitor associated with the display, 0xFFFFFFFF is returned.
(Read only property)

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


The biggest plugin in space...