140 likes | 152 Views
Learn how to use WinBGIm graphics library for C programming, including functions for initializing the graphics mode, drawing lines, setting colors, and more. This tutorial covers key concepts with clear examples and references for further learning.
E N D
WinBGIm 授課:ANT 日期:2019/3/5
標頭檔 • #include"graphics.h"
Initgraphfunction void initgraph(int *graphdriver, int *graphmode, char *pathtodriver);
graphmode * graphmode是整數,用於指定初始圖形模式 如果graphdriver=DETECT, graphmode會被設定為最高解析度,以便檢測驅動
getmaxx, getmaxyfunction • 返回最大的X,Y座標 • maxx = getmaxx(); • maxy = getmaxy();
line function • void line(int x1, int y1, int x2, int y2); • line(100, 100, 200, 200);
getx, getx 取得目前x,y的座標
Reference • http://www.cs.colorado.edu/~main/bgi/doc/initgraph.html • http://www.programmingsimplified.com/c/graphics.h
說明 int gdriver = DETECT; int gmode; initgraph(&gdriver,&gmode,"");
Lab 寫一個程式,讓畫面顯示你自己的名字
OpenCV http://monkeycoding.com/?page_id=12