CoreGraphics Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The CoreGraphics namespace provides access to a C-based low-level 2D graphics API.
Classes
| Name | Description |
|---|---|
| CGAdaptiveKeys | |
| CGAdaptiveOptions | |
| CGBitmapContext |
CGContext backed by an in-memory bitmap. |
| CGBitmapInfoExtensions | |
| CGColor |
Color structure. |
| CGColorConversionInfo | |
| CGColorConversionOptions | |
| CGColorSpace |
Colorspace, determines how Quartz interprets color information. |
| CGColorSpaceNames |
Provides string constants whose values are known color spaces. |
| CGConstantColorExtensions |
Extension methods for the CGConstantColor enumeration. |
| CGContext |
Graphics context and primitives to draw in them. |
| CGContextPDF |
PDF Rendering CGContext class. Use this class to create a CGContext that will output the results to a PDF file. |
| CGDataConsumer |
Data sink for CGContextPDF or CGImageDestination to store data on. |
| CGDataProvider |
A class that wraps a data source and exposes it to the CGImage class. |
| CGDisplay | |
| CGDisplayStreamKeys | |
| CGDisplayStreamYCbCrMatrixOptionKeys | |
| CGDynamicRangeExtensions |
Extension methods for the CGDynamicRange enumeration. |
| CGEvent | |
| CGEventSource | |
| CGFont |
Font support. |
| CGFunction |
A callback function to be used with various CoreGraphics functions. |
| CGGradient |
Gradient definitions. |
| CGImage |
Represents bitmap images and bitmap masks. |
| CGImageProperties |
Properties of bitmap images. |
| CGImagePropertiesExif |
Standard Exif metadata of an image. |
| CGImagePropertiesGps |
Location properties associated with an image. |
| CGImagePropertiesIptc |
Properties with IPTC metadata in an image. |
| CGImagePropertiesJfif |
Properties associated with JFIF bitmap images. |
| CGImagePropertiesPng |
Properties associated with PNG bitmap images. |
| CGImagePropertiesTiff |
Properties associated with TIFF images. |
| CGLayer |
A hardware accelerated context. |
| CGPath |
A drawing path is made up of lines, arcs, beziers that can be used to paint. |
| CGPattern |
A pattern to draw in a CGContext. |
| CGPDFArray |
Represents a PDF array |
| CGPDFContentStream |
Class that gets PDF resources as an object or stream. |
| CGPDFDictionary |
Represents a PDF Dictionary. |
| CGPDFDocument |
PDF Document. |
| CGPDFInfo |
Auxiliary parameters for constructing a CGContextPDF. |
| CGPDFObject |
Class that represents various objects in a PDF document. |
| CGPDFOperatorTable |
Class for storing callbacks for processing PDF documents. |
| CGPDFOutlineOptions | |
| CGPDFPage |
A PDF Page in a PDF Document. |
| CGPDFPageInfo |
Specifies various boxes for the BeginPage(CGPDFPageInfo) method. |
| CGPDFScanner |
Class that enables app developers to parse values from a PDF stream. |
| CGPDFStream |
A PDF Stream. |
| CGPdfTagProperties | |
| CGPdfTagType_Extensions | |
| CGPointDictionary |
This class represents a CGPoint stored in a dictionary; that is a dictionary with "X" and "Y" keys for the corresponding CGPoint fields. |
| CGRectDictionary |
This class represents a CGRect stored in a dictionary; that is a dictionary with "X", "Y", Width" and "Height" keys for the corresponding CGRect fields. |
| CGRectExtensions |
Extensions to the CGRect class that are useful when using CoreGraphics. |
| CGRenderingBufferProvider |
This struct is used when creating adaptive bitmap contexts. |
| CGSession | |
| CGSessionKeys | |
| CGSessionProperties | |
| CGShading |
A type that represents a Quartz shading. |
| CGSizeDictionary |
This class represents a CGSize stored in a dictionary; that is a dictionary with "Width" and "Height" keys for the corresponding CGSize fields. |
| CGToneMappingOptionKeys | |
| CGToneMappingOptions |
A dictionary of tone mapping options. |
Structs
| Name | Description |
|---|---|
| CGAffineTransform |
2D Affine transformation used to convert between coordinate spaces. |
| CGBitmapParameters |
This struct contains values used when creating an adaptive bitmap context. |
| CGColorConversionInfoTriple | |
| CGContentInfo |
This struct contains values used when creating an adaptive bitmap context. |
| CGContentToneMappingInfo |
A struct that defines tone mapping information. |
| CGEventTapInformation | |
| CGPathElement |
An individual element on a CGPath. |
| CGPoint |
Structure defining a 2D point. |
| CGRect |
Structure defining a rectangle in terms of location and size. |
| CGSize |
Structure containing height and width values. |
| CGVector |
A mathematical vector, with value equality implemented. |
| NMatrix2 | |
| NMatrix3 | |
| NMatrix4 | |
| NMatrix4d | |
| NMatrix4x3 | |
| NQuaterniond | |
| NVector16b |
Represents a native vector_byte16 type, which contains 16 byte values. |
| NVector2d | |
| NVector2i | |
| NVector3 | |
| NVector3d | |
| NVector3i | |
| NVector4d | |
| NVector4i | |
| RMatrix3 | |
Enums
| Name | Description |
|---|---|
| CGBitmapFlags |
Bitmap encoding. |
| CGBitmapInfo | |
| CGBitmapLayout | |
| CGBlendMode |
Blending mode used during composition. |
| CGCaptureOptions | |
| CGColorConversionInfoTransformType | |
| CGColorModel | |
| CGColorRenderingIntent |
Determines how Quartz maps colors from the source color space to the gamut of the destination. |
| CGColorSpaceModel |
Color space model. |
| CGComponent | |
| CGConstantColor | |
| CGDynamicRange | |
| CGEventField |
This enum represents constants used to access specialized fields in low-level events. |
| CGEventFilterMask | |
| CGEventFlags | |
| CGEventMask | |
| CGEventMouseSubtype | |
| CGEventSourceStateID | |
| CGEventSuppressionState | |
| CGEventTapLocation | |
| CGEventTapOptions | |
| CGEventTapPlacement | |
| CGEventType | |
| CGGradientDrawingOptions |
Drawing location for gradients. |
| CGImageAlphaInfo |
Specifies the bitmap layout information. |
| CGImageByteOrderInfo | |
| CGImageColorModel |
An enumeration of valid color models. |
| CGImageComponentInfo | |
| CGImagePixelFormatInfo | |
| CGInterpolationQuality |
Quality of interpolation for drawing images. |
| CGLineCap |
Style for line caps. |
| CGLineJoin |
Join type for drawing operations. |
| CGMouseButton | |
| CGPathDrawingMode |
Drawing mode. |
| CGPathElementType |
The type of an element in a CGPath. |
| CGPatternTiling |
Pattern styling style. |
| CGPDFAccessPermissions | |
| CGPDFBox |
Type of box in a PDF document. |
| CGPDFDataFormat |
Enumerates values that indicate the data format of a PDF. |
| CGPDFObjectType |
Enumerates the various types of values that are found in a PDF document. |
| CGPdfTagType | |
| CGRectEdge |
Coordinates used to establish the edge in RectangleFExtensions.Divide. |
| CGScrollEventUnit | |
| CGTextDrawingMode |
Text drawing mode used by Quartz. |
| CGTextEncoding |
Text encoding, this enumeration is deprecated, use CoreText APIs instead. |
| CGToneMapping | |
| CGWindowImageOption | |
| CGWindowListOption | |
| MatrixOrder | |
Delegates
| Name | Description |
|---|---|
| CGBitmapContext.OnAllocateCallback | |
| CGBitmapContext.OnErrorCallback | |
| CGBitmapContext.OnFreeCallback | |
| CGBitmapContext.OnResolveCallback | |
| CGEvent.CGEventTapCallback | |
| CGFunction.CGFunctionEvaluate |
A delegate used to specify the callback function of a CGFunction. |
| CGPath.ApplierFunction |
A function that can make changes to a CGPathElement. |
| CGPattern.DrawPattern |
Callback signature used to draw patterns on the screen. |
| CGPDFArray.ApplyCallback | |
| CGPDFDictionary.ApplyCallback | |
| CGRenderingBufferProvider.LockPointerCallback | |
| CGRenderingBufferProvider.ReleaseInfoCallback | |
| CGRenderingBufferProvider.UnlockPointerCallback | |
Remarks
This namespace contains a binding to the two-dimensional bitmap and vector graphics APIs. To learn more about the capabilities of CoreGraphics you can read Apple's Quartz 2D Programming Guide.
Many graphics use cases can be addressed using higher-level APIs such as those provided in UIKit, GLKit, and SpriteKit. However, some Core Graphics classes such as CGLayer, CGContext, and CGImage are not uncommonly seen in general UI tasks. In such situations, the Core Graphics class will often have more flexibility in terms of lower-level manipulation but requires more attention from the developer in terms of resource and state management.