Platforms to show: All Mac Windows Linux Cross-Platform

Back to Window class.

Window.CGContextMBS as CGContextMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
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)

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.

But on a Cocoa window the context is not always available, so in the window paint event, you can context from Graphics object.

Some examples using this method:

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


The biggest plugin in space...