그래픽 라이브러리 - gxLib
글 수 28
설명
gx_hline()은 지정한 색상으로 수평선을 긋습니다. 수평으로 어디서 어디까지의 x 좌표 2개와 수직의 y 좌표를 지정합니다.
| 헤더 | gx.h | ||||||||||||||||
| 형태 | void gx_hline( dc_t *dc, int x_1st, int x_2nd, int coor_y, color_t color); | ||||||||||||||||
| 인수 |
| ||||||||||||||||
| 반환 |
| ||||||||||||||||
예제
#include <stdio.h>
#include <gx.h>
#include <gxbdf.h>
int main( void)
{
dc_t *dc_screen; // 화면 Device Context
color_t clr_red;
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_red = gx_color( 255, 0, 0, 255); // 빨강색을 만듦
clr_blue = gx_color( 0, 0, 255, 255); // 빨강색을 만듦
// 화면을 깨끗하게
gx_clear( dc_screen, gx_color( 0, 0, 0, 255));
gx_hline( dc_screen, 0, 300, 50, gx_color( 255, 255, 255, 255));
gx_hline( dc_screen, 0, 300, 100, clr_red);
gx_hline( dc_screen, 0, 300, 150, clr_blue);
gx_release_dc( dc_screen);
}
gx_close();
}
return 0;
}
]$ ./a.out



