CGBitmapContextCreate 문서 번역

3351 단어
Creates a bitmap graphics context.(비트맵 드로잉 컨텍스트 작성)

Declaration

CGContextRef CGBitmapContextCreate(void *data, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, CGColorSpaceRef space, uint32_t bitmapInfo);

Parameters


data
A pointer to the destination in memory where the drawing is to be rendered. The size of this memory block should be at least (bytesPerRow*height) bytes. Pass NULL if you want this function to allocate memory for the bitmap. This frees you from managing your own memory, which reduces memory leak issues.
그림을 그릴 때 할당된 메모리 주소를 가리킵니다.메모리 블록은 최소 (bytesPerRow*height) 바이트여야 합니다.비트맵에 적합한 크기의 메모리 블록을 자동으로 만들어야 할 경우 NULL로 전송하여 시스템에서 메모리를 관리하여 메모리 누수를 줄일 수 있습니다.
width
The width, in pixels, of the required bitmap.
비트맵의 너비(px)
height
The height, in pixels, of the required bitmap.
비트맵의 높음(단위 px)
bitsPerComponent
The number of bits to use for each component of a pixel in memory. For example, for a 32-bit pixel format and an RGB color space, you would specify a value of 8 bits per component. For the list of supported pixel formats, see “Supported Pixel Formats” in the Graphics Contexts chapter of Quartz 2D Programming Guide.
메모리에 있는 픽셀 컴포넌트의 개수를 나타냅니다.예를 들어, 32비트 픽셀 형식인 RGB 색상 공간은 각 컴포넌트에 8bit 값을 할당해야 합니다. 지원되는 픽셀 형식은 Graphics Contexts의 Quartz 2D Programming Guide를 참조하십시오.Supported Pixel Formats에 대한 설명
bytesPerRow
The number of bytes of memory to use per row of the bitmap. If the data parameter is NULL, passing a value of 0 causes the value to be calculated automatically.
비트맵의 행당 바이트 수입니다.매개 변수 데이터가 NULL이면 0을 입력하여 자동으로 계산합니다
colorspace
The color space to use for the bitmap context. Note that indexed color spaces are not supported for bitmap graphics contexts.
비트맵 컨텍스트에 사용되는 색상 공간입니다.주의해야 할 것은 비트맵 상하문에서 색 공간 인덱스를 지원하지 않는다는 것이다.
bitmapInfo
Constants that specify whether the bitmap should contain an alpha channel, the alpha channel’s relative location in a pixel, and information about whether the pixel components are floating-point or integer values. The constants for specifying the alpha channel information are declared with the CGImageAlphaInfo type but can be passed to this parameter safely. You can also pass the other constants associated with the CGBitmapInfo type. For an example of how to specify the color space, bits per pixel, bits per pixel component, and bitmap information, see Graphics Contexts.
비트맵에 알파 채널이 포함되어 있는지, 알파 채널이 픽셀에서 상대적인 위치인지, 픽셀 분량이 정수인지 부동점수인지 지정합니다.알파 채널 정보를 지정하는 상수는 CGImageAlphaInfo 클래스를 통해 선언되지만 이 매개변수를 안전하게 전달할 수 있습니다.너도 다른 CGBitmapInfo류와 관련된 상수를 전달할 수 있다.
색상 공간, 픽셀 바이트, 픽셀 분량 바이트를 어떻게 지정하는지 알고 싶으면 Graphics Contexts를 참고하십시오.
Discussion
When you draw into this context, Core Graphics renders your drawing as bitmapped data in the specified block of memory. The pixel format for a new bitmap context is determined by three parameters—the number of bits per component, the color space, and an alpha option (expressed as a CGBitmapInfo constant). The alpha value determines the opacity of a pixel when it is drawn.
이 위아래 문장을 그릴 때, CG는 지정한 메모리 블록의 비트맵 데이터로 그림을 그립니다.새 비트맵 컨텍스트의 픽셀 형식은 각 컴포넌트의 자릿수, 색상 공간, 알파 옵션(CGBitmapInfo 상수로 표시됨) 등 세 가지 매개변수를 통해 선언됩니다.알파 값은 픽셀을 그릴 때의 불투명도를 명확하게 합니다.

좋은 웹페이지 즐겨찾기