Platforms to show: All Mac Windows Linux Cross-Platform

Back to DisplayMBS class.

DisplayMBS.CanDepth(depth as Integer) As Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Returns true if the monitor supports the given color depth at the current ResolutionMBS.

none.

DisplayMBS.FadeGamma(intensity as Integer, col As Color)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Sets the gamma of the DisplayMBS

Intensity has to be between 0 and 1000. 1000 is normal, when it is 0, the whole DisplayMBS is in the color GammaColor.
Direct color display modes do not use color lookup tables and are usually 16, 24, or 32 bit. Not all direct color video boards support loadable gamma ramps.

See the NativeGamma documentation for more details on Windows Gamma details.

Some examples using this method:

DisplayMBS.FadeGammaTo(intensity as Integer, col As Color, ticks as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Fades the intensity and color of the gamma slowly in the given number of milliseconds.

Intensity has to be between 0 and 1000. 1000 is normal, when it is 0, the whole display is in the color GammaColor.
Direct color display modes do not use color lookup tables and are usually 16, 24, or 32 bit. Not all direct color video boards support loadable gamma ramps.
See the NativeGamma documentation for more details on Windows Gamma details.

Some examples using this method:

DisplayMBS.GetBestResolution(width as Integer, height as Integer, depth as Integer, safe As Boolean) As ResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Searches for the best matching resolution.

Returns the best resolution which size is not smaller that the dimensions given, which has the given depth and, if safe is true, which is safe. If safe is not true, be sure that the frequency works, if you want to switch to it (for example by asking the user).
On Mac OS X till now no resolution can be called safe.

See also:

DisplayMBS.GetBestResolution(width as Integer, height as Integer, safe As Boolean) As ResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Searches for the best matching resolution.

Returns the best resolution which size is not smaller that the dimensions given, which has the highest depth and, if safe is true, which is safe. If safe is not true, be sure that the frequency works, if you want to switch to it (for example by asking the user).
On Mac OS X till now no resolution can be called safe.

See also:

DisplayMBS.GetCurrentResolution As ResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Returns the current resolution.

Returns the resolution the display is currently set to. This is useful if you want to switch back to the old resolution after you switched to another resolution.

Some examples using this method:

DisplayMBS.GetLargestResolution(depth as Integer, safe As Boolean) As ResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Searches for the largest resolution with the given depth.

The same as GetBestResolution(width, height, depth, safe), the only difference is that it does not search for the smallest resolution but for the biggest one.
On Mac OS X till now no resolution can be called safe.

See also:

DisplayMBS.GetLargestResolution(safe As Boolean) As ResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Searches for the largest resolution.

If safe is true, this method returns only safe resolutions.
On Mac OS X till now no resolution can be called safe.

See also:

DisplayMBS.GetResolution(num as Integer) As ResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Returns a resolution.

Num has to be between 0 and ResolutionCount(safe)-1.

DisplayMBS.NativeGamma as memoryblock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Resolution MBS Util Plugin 3.0 ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
The native gamma values.
Example
dim d as DisplayMBS // your display
d.nativegamma=newmemoryblock(3072) // all black

3072 bytes big is this array a 256 RGB values saved in 3 single properties.

Some notes for SetDeviceGammaRamp, which is the Windows function used by the plugin:

SetDeviceGammaRamp doesn't allow all gamma ramps. It checks the gamma ramp; if it is too complex, such as the red flash when the player is shot in Quake, it rejects it.
SetDeviceGammaRamp will not currently make use of a gamma calibrator. This may change in future versions of Image Color Management (ICM), but for Windows 2000, only the DirectDraw API supports the gamma calibrators.
The existing gamma entry points is already used by GetDeviceGammaRamp and SetDeviceGammaRamp. Therefore, the display driver doesn't need to do anything special to support this new interface, as long as it already supports the Win32 Get/SetDeviceGammaRamp functions.
In addition to getting and setting gamma ramps, the new DirectDraw interface allows the new gamma ramp to be calibrated—if a gamma calibrator is installed. The mechanism that DirectDraw uses to register and communicate with the gamma calibrator is an interim mechanism that will be changed in future releases.
DirectDraw looks for an installed software calibrator and passes the gamma value to the software calibrator; the software calibrator in turn adjusts the gamma ramp according to the measured response of the monitor. The calibrator passes the gamma ramp back to DirectDraw, which passes it to the SetDeviceGammaRamp device driver interface (DDI). The result is that the game looks as intended.
For DirectDraw to use the gamma calibrator, the calibrator must register itself with DirectDraw using a registry key; DirectDraw will call it if the application wants the gamma ramp to be calibrated.
In the future, both the method by which DirectDraw communicates with the gamma calibrator, through the DDI, and the method gamma calibrators use to register themselves in the registry will change. But every part of the DirectDraw API is permanent.
ICM is the color management system in Windows; all system-level color management should be handled by ICM. For this reason, downloadable gamma ramp support will be rolled into ICM in the future, making current solutions for gamma calibrators obsolete. Until such time, we have provided a method by which applications can take advantage of the installed base of software calibrators and graphics adapters that support downloadable gamma ramps.
(Read and Write computed property)

Some examples using this property:

DisplayMBS.ResolutionCount(depth as Integer, safe As Boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Returns the number of resolutions for a given depth.

This method returns the number of resolutions that have the given depth and, if safe is true, which are safe.
On Mac OS X till now no ResolutionMBS can be called safe.

See also:

DisplayMBS.ResolutionCount(safe As Boolean) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Returns the number of resolutions.

This method returns the total number of resolutions this monitor supports and, if safe is true, which are safe. Safe resolutions are resolutions which will always work.
On Mac OS X till now no ResolutionMBS can be called safe.

See also:

DisplayMBS.SetDepth(depth as Integer) As Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Switches the color depth to the depth given. Returns true if attempt was successful.

none.

DisplayMBS.SwitchTo(width as Integer, height as Integer, depth as Integer, safe As Boolean) As Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Switches to the given ResolutionMBS if possible.

This method tries to switch directly to the best ResolutionMBS which size is bigger or the same as the given dimensions and which depth is the same as the given parameter. It returnes true if it was successful. Try this function first with safe set to true. If that fails, try again with false, but after that show a dialog asking the user if that ResolutionMBS is okay. If the user presses escape or clicks cancel, you should immediatly switch back to the old ResolutionMBS.
On Mac OS X till now no ResolutionMBS can be called safe.

Some examples using this method:

DisplayMBS.Update

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Resolution MBS Util Plugin 3.1 ✅ Yes ✅ Yes ❌ No ❌ No Desktop only
Updates the properties in this class.

Call it whenever you detect a screen resolution change to update the content of this class.
In general you should not keep DisplayMBS classes around too long because the display described may go away (one a Powerbook the external display).

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


The biggest plugin in space...