CGBitmapContext

A type of CGContextRef that you can use for drawing bits to memory.

Overview

The number of components for each pixel in a bitmap graphics context is specified by a color space, defined by a CGColorSpaceRef. The bitmap graphics context specifies whether the bitmap should contain an alpha channel, and how the bitmap is generated.

Topics

Creating Bitmap Contexts

CGBitmapContextCreate

Creates a bitmap graphics context.

CGBitmapContextCreateWithData

Creates a bitmap graphics context with the specified callback function.

CGBitmapContextCreateImage

Creates and returns a CGImage from the pixel data in a bitmap graphics context.

Getting Information About Bitmap Contexts

These functions return the values of attributes specified when a bitmap context is created.

CGBitmapContextGetBitmapInfo

Obtains the bitmap information associated with a bitmap graphics context.

CGBitmapContextGetAlphaInfo

Returns the alpha information associated with the context, which indicates how a bitmap context handles the alpha component.

CGBitmapContextGetBitsPerComponent

Returns the bits per component of a bitmap context.

CGBitmapContextGetBitsPerPixel

Returns the bits per pixel of a bitmap context.

CGBitmapContextGetBytesPerRow

Returns the bytes per row of a bitmap context.

CGBitmapContextGetColorSpace

Returns the color space of a bitmap context.

CGBitmapContextGetData

Returns a pointer to the image data associated with a bitmap context.

CGBitmapContextGetHeight

Returns the height in pixels of a bitmap context.

CGBitmapContextGetWidth

Returns the width in pixels of a bitmap context.

Data Types

CGBitmapContextReleaseDataCallback

A callback function used to release data associate with the bitmap context.

See Also

Opaque Types

CGColor

A set of components that define a color, with a color space specifying how to interpret them.

CGColorConversionInfo

An object that describes how to convert between color spaces for use by other system services.

CGColorSpace

A profile that specifies how to interpret a color value for display.

CGContext

A Quartz 2D drawing destination.

CGDataConsumer

An abstraction for data-writing tasks that eliminates the need to manage a raw memory buffer.

CGDataProvider

An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer.

CGFont

A set of character glyphs and layout information for drawing text.

CGFunction

A general facility for defining and using callback functions.

CGGLContext

Deprecated. A type of CGContextRef for drawing OpenGL content.

CGGradient

A definition for a smooth transition between colors for drawing radial and axial gradient fills.

CGImage

A bitmap image or image mask.

CGLayer

An offscreen context for reusing content drawn with Core Graphics.

CGPath

Immutable and mutable types for graphics paths: mathematical descriptions of shapes or lines to be drawn in a graphics context.

CGPattern

A 2D pattern to be used for drawing graphics paths.

CGPDFArray

An array structure within a PDF document.

CGPDFContentStream

A representation of one or more content data streams in a PDF page.

CGPDFContext

A type of CGContextRef for drawing PDF content.

CGPDFDictionary

A dictionary structure within a PDF document.

CGPDFDocument

A document that contains PDF (Portable Document Format) drawing information.

CGPDFObject

An object representing content within a PDF document.

CGPDFOperatorTable

A set of callback functions for operators used when scanning content in a PDF document.

CGPDFPage

A page in a PDF document.

CGPDFScanner

A parser object for handling content and operators in a PDF content stream.

CGPDFStream

A stream or sequence of data bytes in a PDF document.

CGPDFString

A text string in a PDF document.

CGPSConverter

An object that converts PostScript data to PDF data.

CGShading

A definition for a smooth transition between colors, controlled by a custom function you provide, for drawing radial and axial gradient fills.