그래픽 라이브러리 - gxLib
글 수 28
설명
DC가 가지고 있는 pen_color 색상으로 선을 긋습니다.
| 헤더 | gx.h | |||||||||||
| 형태 | void gx_line( dc_t *dc, int x1, int y1, int x2, int y2) | |||||||||||
| 인수 |
| |||||||||||
| 반환 |
| |||||||||||
예제
아래의 예는 Screen DC를 구한 후, Screen DC를 이용하여 화면에 선을 긋습니다.
#include <stdio.h>
#include <gx.h>
int main( void)
{
dc_t *dc_screen; // 화면 Device Context
if ( gx_init( "/dev/fb")) gx_print_error( "");
else
{
if ( !( dc_screen = gx_get_screen_dc())) // 화면 출력을 위한 스크린 DC 구함
gx_print_error( ""); // 실행 중 에러가 있었다면 에러 내용을 출력
else
{
gx_clear( dc_screen, gx_color( 0, 0, 0, 255));
dc_screen->pen_color = gx_color( 255, 255, 255, 255); // 펜 색을 백색으로 지정
gx_line( dc_screen, 0, 0, gx_fb.width, gx_fb.height);
gx_release_dc( dc_screen);
}
gx_close();
}
return 0;
}



