CGBitmapContextMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

CGBitmapContextMBS class

Super class: CGContextMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
A class to hold a CoreGraphics bitmap context.
Example
Sub Paint(g As Graphics)
dim c as CGPictureContextMBS
dim w as CGContextMBS // of window
dim p,m as Picture

c=new CGPictureContextMBS(100,100)

c.ClearRect CGMakeRectMBS(0,0,100,100)
c.SetRGBFillColor 1,0,0,1
c.FillRect CGMakeRectMBS(0,0,50,50)

w=window1.CGContextMBS // we are inside paint event!
// Draw using CGImage
w.DrawPicture c.CGImage(false,0),CGMakeRectMBS(0,0,c.BitmapWidth,c.BitmapHeight)
w.Flush

// Draw using RB picture, so we can see whether it looks equal.
m=c.CopyPictureMask
p=New Picture(m.Width,m.Height,32)
p.Graphics.DrawPicture c.CopyPicture,0,0
p.Mask.Graphics.DrawPicture m,0,0
g.DrawPicture p,0,0

End Sub

If the RB graphics class is like a CGContext, the RB picture class (created using NewPicture) is something like a CGBitmapContext.
Subclass of the CGContextMBS class.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.

Super class CGContextMBS

This class has no sub classes.

Some useful global functions for this class:

Some examples using this class:

Blog Entries


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


CGAffineTransformMBS   -   CGColorMBS


💬 Ask a question or report a problem