Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

window.CGColorSpaceMBS as CGColorSpaceMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property CoreGraphics MBS MacCG Plugin 10.4 Yes No No No No
Function: Get or set the colorspace profile for this window.
Example:
dim c as CGColorSpaceMBS = window1.CGColorSpaceMBS

if c<>Nil then
MsgBox str(c.NumberOfComponents)
else
MsgBox "nil"
end if
Notes:
Requires Mac OS X 10.6.

On Cocoa, the NSColorSpace is queried and the matching CGColorspace is returned. For setting a NSColorSpace is created for the given CGColorspace.
In Carbon applications, the CoreGraphics color space is passed directly.
(Read and Write computed property)

Some examples which use this property:

Feedback, Comments & Corrections

Window.CGContextMBS as CGContextMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 2.7 Yes No No No No
Function: Creates a new CGContextMBS object for the given Window.
Example:
dim CGContext as CGContextMBS
dim OverlayPic as Picture=LogoMBS(500)
dim contentpicture as CGImageMBS= CGCreateImageMBS(OverlayPic)

CGContext=window1.CGContextMBS

CGContext.ClearRect CGMakeRectMBS(0, 0, OverlayPic.width, OverlayPic.height)
CGContext.DrawPicture contentpicture, CGMakeRectMBS(0, 0, OverlayPic.width, OverlayPic.height)
Notes:
Requires Mac OS X to work.
Please make sure the CGContextMBS object is released in the paint event if you use it there, so all the drawings are flushed. Not releasing it my be visible in missing statictext or other strange graphics effects.

Version 9.8 adds support for Cocoa target.
But on a Cocoa window the context is not always available, so in the window paint event, you can use GetCurrentCGContextMBS.

Some examples which use this method:

Feedback, Comments & Corrections

Window.ClearTransparencyMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS Util Plugin 5.0 Yes No No No No
Function: Clears transparency of a window.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins