Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGBitmapContextMBS class.

CGBitmapContextMBS.BitmapAlphaInfo as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the alpha info of the bitmap.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// shows 2 for kCGImageAlphaPremultipliedFirst
MsgBox str(b.BitmapAlphaInfo)

Returns 0 on any error.

CGImageAlphaInfo constants:
kCGImageAlphaNone0
kCGImageAlphaPremultipliedLast1For example, premultiplied RGBA
kCGImageAlphaPremultipliedFirst2For example, premultiplied ARGB
kCGImageAlphaLast3For example, non-premultiplied RGBA
kCGImageAlphaFirst4For example, non-premultiplied ARGB
kCGImageAlphaNoneSkipLast5Equivalent to kCGImageAlphaNone.
kCGImageAlphaNoneSkipFirst6
(Read only property)

CGBitmapContextMBS.BitmapBitsPerComponent as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the bits per component of the bitmap.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// shows 8
MsgBox str(b.BitmapBitsPerComponent)

Returns 0 on any error.
(Read only property)

CGBitmapContextMBS.BitmapBitsPerPixel as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the bits per pixel of the bitmap.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// shows 32
MsgBox str(b.BitmapBitsPerPixel)

Returns 0 on any error.
(Read only property)

CGBitmapContextMBS.BitmapBytesPerRow as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the bytes per row of the bitmap.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// shows 2000
MsgBox str(b.BitmapBytesPerRow)

Returns 0 on any error.
(Read only property)

CGBitmapContextMBS.BitmapColorSpace as CGColorSpaceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the colorspace used for this bitmap.

Returns nil on any error.

This is not the same RB object used when you created the bitmap, but it will contain the same handle.
(Read only property)

CGBitmapContextMBS.BitmapData as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a memoryblock for the data of the bitmap.

Returns nil on any error.

This is not the same RB memoryblock object as you passed to the Create function, but it will point to the same bytes in memory.
(Read only property)

CGBitmapContextMBS.BitmapHeight as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the height of the bitmap.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// shows 500
MsgBox str(b.BitmapHeight)

Returns 0 on any error.
(Read only property)

CGBitmapContextMBS.BitmapInfo as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 11.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Obtains the bitmap information associated with a bitmap graphics context.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// shows info: 2 for kCGImageAlphaPremultipliedFirst
MsgBox str(b.BitmapInfo)

The bitmap info of the bitmap graphics context or 0 if c is not a bitmap graphics context. See CGImage Reference for a description of the Image Bitmap Information constants that can be returned.

The CGBitmapInfo data returned by the function specifies whether the bitmap contains an alpha channel and how the alpha channel is generated, along with whether the components are floating-point or integer.
(Read only property)

CGBitmapContextMBS.BitmapWidth as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property CoreGraphics MBS MacCG Plugin 3.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the width of the bitmap.
Example
// a new picture in RB
dim pic as new Picture(500, 500)

// and create CGBitmapContextMBS pointing to it
dim b as CGBitmapContextMBS = CGBitmapContextMBS.CreateWithPicture(pic)

// show info: 500
MsgBox str(b.BitmapWidth)

Returns 0 on any error.
(Read only property)

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


The biggest plugin in space...