Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

CGDisplayMBS.BeamPosition as UInt32
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: Returns the current beam position on the display.
Example:
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.BeamPosition)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.Bounds as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: Return screen size and origin in global coords.
Notes:
Empty rect or nil if display is invalid.
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.Brightness as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 15.0 Yes No No Yes, macOS only No
Function: Get/Set brightness of display.
Notes:
Returns -1 if not supported.
Lasterror is set.
(Read and Write property)

Feedback, Comments & Corrections

CGDisplayMBS.CanSetPalette as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: Returns true if the current display mode supports palettes.
Example:
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.CanSetPalette)
Notes: (Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.ColorSpace as CGColorSpaceMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.CurrentMode as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: 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)
Notes:
Returns nil on any error.
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.DisplayMode as CGDisplayModeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 11.1 Yes No No Yes, macOS only No
Function: 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)
Notes:
Returns nil on any error.
Requires Mac OS X 10.6
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.DisplayProductNames as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 14.4 Yes No No Yes, macOS only No
Function: 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", "?")
Notes: (Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.Handle as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: The handle to the current display.
Notes:
Internally: The DisplayID.
0 is the main display (to keep it easier).
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.IOServicePort as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 11.1 Yes No No Yes, macOS only No
Function: Return the IOKit service port of a display.
Notes: (Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.IsActive as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: Returns a Boolean value indicating whether a display is active.
Example:
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.IsActive)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.IsAlwaysInMirrorSet as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.IsAsleep as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.IsBuiltin as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.IsInHWMirrorSet as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.IsInMirrorSet as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes: (Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.IsMain as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
If true, the specified display is currently the main display; otherwise, false.
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.IsOnline as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.IsStereo as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.LastError as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 15.4 Yes No No Yes, macOS only No
Function: The last error code.
Notes:
Only set for a few properties like brightness where we do have an error code.
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.MirrorsDisplay as CGDisplayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: For a secondary display in a mirroring set, returns the primary display.
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.ModelNumber as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: Returns the model number of a display monitor.
Example:
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.ModelNumber)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.PixelsHigh as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: Height of the display in pixels.
Notes:
dim d as new CGDisplayMBS // pick main display

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

Feedback, Comments & Corrections

CGDisplayMBS.PixelsWide as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 3.3 Yes No No Yes, macOS only No
Function: Width of the display in pixels.
Example:
dim d as new CGDisplayMBS // pick main display

MsgBox str(D.PixelsWide)
Notes: (Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.PrimaryDisplay as CGDisplayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: Returns the primary display in a hardware mirroring set.
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.RefreshRate as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 15.1 Yes Yes Yes Yes No
Function: Queries refresh rate in Hz for this display.
Example:
dim m as CGDisplayMBS = CGDisplayMBS.MainDisplay
MsgBox str(m.RefreshRate)+" Hz"
Notes:
Returns 60 for LCD displays.
(Read only property)

Feedback, Comments & Corrections

CGDisplayMBS.Rotation as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: Returns the rotation angle of a display in degrees.
Example:
dim d as new CGDisplayMBS // pick main display

MsgBox str(d.Rotation)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.ScreenSizeHeight as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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)
Notes:
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)

Feedback, Comments & Corrections

CGDisplayMBS.ScreenSizeWidth as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 8.6 Yes No No Yes, macOS only No
Function: 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
Notes:
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)

Feedback, Comments & Corrections

Next items

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




Links
MBS FileMaker blog