?? 例4-9.c
字號:
/* Note:Your choice is C IDE */
#include<graphics.h>
#include<stdio.h>
#include<graphics.h>
main()
{
int graphdriver=VGA,graphmode=VGAHI;
struct fillsettingstype save;
char savepattern[8];
char gray50[]={0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x81};
initgraph(&graphdriver,&graphmode,"");
getfillsettings(&save); /* 得到初始化時填充模式 */
if(save.pattern!=USER_FILL)
setfillstyle(3,BLUE);
bar(0,0,100,100);
setfillstyle(HATCH_FILL,RED);
pieslice(200,300,90,180,90);
setfillpattern(gray50,YELLOW); /*設定用戶自定義圖形填充模板*/
bar(100,100,200,200);
if(save.pattern==USER_FILL)
setfillpattern(savepattern,save.color);
else
setfillpattern(savepattern,save.color); /*恢復原來的填充模*/
getch();
closegraph();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -