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
Var 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
Var 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
Var 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
Var d as CGDisplayMBS = CGDisplayMBS.MainDisplay
Var 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
Var 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
Var display as CGDisplayMBS = CGDisplayMBS.MainDisplay
Var 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.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
Var 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.

Var 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
Var 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
Var 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
Var 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
Var c as new CGDisplayMBS
Var lines(-1) as string

Var DPIWidth as Double = c.PixelsWide/(c.ScreenSizeWidth/10.0/2.54)
Var 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
Var 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
Var 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
Var 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
Var 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
Var 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...