Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CGDisplayMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class CoreGraphics MBS MacOSXCG Plugin 3.3 Yes No No Yes, macOS only No
Function: 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)

Feedback, Comments & Corrections

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"

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some examples which use this class:


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


CGDisplayConfigMBS   -   CGDisplayModeMBS




Links
MBS Xojo Plugins