그래픽 라이브러리 - gxLib
글 수 28
설명
브러쉬의 색상을 변경합니다. 부러쉬는 사각형이나 원, 타원의 내부를 채울 때 사용됩니다.
| 헤더 | gx.h | |||||||
| 형태 | void gx_brush_color( dc_t *dc, color_t color); | |||||||
| 인수 |
| |||||||
| 반환 |
| |||||||
예제
#include <stdio.h>
#include <gx.h>
int main( void)
{
dc_t *dc_screen; // 화면 Device Context
color_t clr_white;
color_t clr_blue;
if ( gx_init( "/dev/fb")) // gxLib 초기화
gx_print_error( ""); // 실행 중 에러 내용을 출력
else
{
if ( !( dc_screen = gx_get_screen_dc())) // 화면 출력을 위한 스크린 DC 구함
gx_print_error( ""); // 실행 중 에러 내용을 출력
else
{
clr_white = gx_color( 255, 255, 255, 255); // 백색을 만듦
clr_blue = gx_color( 0, 0, 255, 255); // 파랑색 준비
// 화면을 깨끗하게
gx_clear( dc_screen, gx_color( 0, 0, 0, 255));
// 펜 색상을 백색으로 지정 후 선 긋기
gx_pen_color( dc_screen, clr_white);
gx_brush_color( dc_screen, clr_blue);
gx_circle( dc_screen, 100, 100, 50);
// 화면 출력용 Device Context 사용 중지
gx_release_dc( dc_screen);
}
gx_close();
}
return 0;
}
]$ ./a.out



