(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO

Similar documents
joho07-1.ppt

PowerPoint Presentation

‚æ4›ñ

‚æ2›ñ C„¾„ê‡Ìš|

8 / 0 1 i++ i 1 i-- i C !!! C 2

ex12.dvi

Microsoft Word - C.....u.K...doc

cpp4.dvi

r08.dvi

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

10

Informatics 2014

ohp08.dvi

void hash1_init(int *array) int i; for (i = 0; i < HASHSIZE; i++) array[i] = EMPTY; /* i EMPTY */ void hash1_insert(int *array, int n) if (n < 0 n >=

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

17 1. strucr Potter ( ) Harry Potter and the Philosopher s Stone 1997 English Title : Harry Potter and the Philosopher s Stone : : 1997 #include<stdio

r07.dvi

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>

ohp03.dvi

/* sansu1.c */ #include <stdio.h> main() { int a, b, c; /* a, b, c */ a = 200; b = 1300; /* a 200 */ /* b 200 */ c = a + b; /* a b c */ }

ohp07.dvi

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

untitled

:30 12:00 I. I VI II. III. IV. a d V. VI

untitled

C C UNIX C ( ) 4 1 HTML 1

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

C言語によるアルゴリズムとデータ構造

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

Taro-リストⅢ(公開版).jtd

r03.dvi

Informatics 2010.key


Prog1_15th

Informatics 2015

第3回 配列とリスト

新・明解C言語 実践編

:30 12:00 I. I VI II. III. IV. a d V. VI

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç

画像ファイルを扱う これまでに学んだ条件分岐, 繰り返し, 配列, ファイル入出力を使って, 画像を扱うプログラムにチャレンジしてみよう

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

P05.ppt

u302.book

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

cpp1.dvi

橡Pro PDF

A/B (2018/06/08) Ver kurino/2018/soft/soft.html A/B

ex01.dvi

超初心者用

プログラミング基礎

新・明解C言語 ポインタ完全攻略

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n

Quartus II ハンドブック Volume 5、セクションIV. マルチプロセッサの調整

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

ユニセフ表紙_CS6_三.indd

3.1 stdio.h iostream List.2 using namespace std C printf ( ) %d %f %s %d C++ cout cout List.2 Hello World! cout << float a = 1.2f; int b = 3; cout <<

Microsoft Word - Training10_プリプロセッサ.docx

(Version: 2017/4/18) Intel CPU 1 Intel CPU( AMD CPU) 64bit SIMD Inline Assemler Windows Visual C++ Linux gcc 2 FPU SSE2 Intel CPU do

: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

ex01.dvi

Microsoft PowerPoint - kougi8.ppt

Microsoft PowerPoint - CproNt02.ppt [互換モード]

debug ( ) 1) ( ) 2) ( ) assert, printf ( ) Japan Advanced Institute of Science and Technology

1 (bit ) ( ) PC WS CPU IEEE754 standard ( 24bit) ( 53bit)

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main

2008 IIA (program) pro(before)+gram(write) (artificial language) (programming languege) (programming) (machine language) (assembly language) ( )

P06.ppt

新版明解C言語 実践編

lexex.dvi

64bit SSE2 SSE2 FPU Visual C++ 64bit Inline Assembler 4 FPU SSE2 4.1 FPU Control Word FPU 16bit R R R IC RC(2) PC(2) R R PM UM OM ZM DM IM R: reserved

Condition DAQ condition condition 2 3 XML key value

Microsoft Word - Sample_CQS-Report_English_backslant.doc

演習課題No12

Microsoft Word - no206.docx

PowerPoint プレゼンテーション

プログラミング方法論 II 第 14,15 回 ( 担当 : 鈴木伸夫 ) 問題 17. x 座標と y 座標をメンバに持つ構造体 Point を作成せよ 但し座標 は double 型とする typedef struct{ (a) x; (b) y; } Point; 問題 18. 問題 17 の

tuat1.dvi


file:///D|/C言語の擬似クラス.txt

untitled

untitled


untitled

char char 1 signed char unsigned char ( ; single-quote 0x27) ASCII Japan Advanced Institute of Science and Technology

C ( ) C ( ) C C C C C 1 Fortran Character*72 name Integer age Real income 3 1 C mandata mandata ( ) name age income mandata ( ) mandat

02: 変数と標準入出力

02: 変数と標準入出力

第3回 配列とリスト

資料5:聖ウルスラ学院英智小・中学校 提出資料(1)

DVIOUT


1 level Level swtich ButtonPress ButtonRelease Expose Level

2009 T

付加情報をもったファイル共有システム

char int float double の変数型はそれぞれ 文字あるいは小さな整数 整数 実数 より精度の高い ( 数値のより大きい より小さい ) 実数 を扱う時に用いる 備考 : 基本型の説明に示した 浮動小数点 とは数値を指数表現で表す方法である 例えば は指数表現で 3 書く

Transcription:

Handy Graphic for Handy Graphic Version 0.5 2008-06-09 1 Handy Graphic Handy Graphic C Handy Graphic Handy Graphic Mac OS X Handy Graphic HgDisplayer Handy Graphic HgDisplayer 2 Handy Graphic 1 Handy Graphic #include <stdio.h> #include <handy.h> /* Handy Graphic */ int main(void) { HgOpen(600, 400); /* */ HgCircle(300, 150, 120); /* (300, 150) 120 */ getchar(); /* */ } return 0; /* */ 1: 600 120 400 150 300 (a) (b) 2: 1

600 400 (300, 150) 120 getchar() 2 3 4 HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgOpen(500, 400); w = 100; h = 40; for (i = 1; i <= 15; i++) { w -= 4; h += 4; HgBox(i * 28, i * 20, w, h); } getchar(); return 0; 3: 4: 3 1 3 draw.c Handy Graphic hgcc $ a.out $ hgcc draw.c cc gcc $ hgcc -Wall -o draw draw.c draw $./draw HgDisplayer HgDisplayer HgDisplayer 2

HgDisplayer HgDisplayer HgDisplayer Handy Graphic 4 4.1 int HgOpen(double w, double h) : w,h: w, h 4.2 int HgSetWidth(double t) : t: 4.3 hgcolor 1 1: HG_WHITE HG_RED HG_CYAN HG_BLACK HG_GREEN HG_ORANGE HG_GRAY HG_BLUE HG_PINK HG_LGRAY HG_YELLOW HG_MAGENTA HG_DGRAY HG_PURPLE HG_BROWN 3

int HgSetColor(hgcolor clr) : clr: int HgSetPaintColor(hgcolor clr) : clr: 4.4 HgDisplayer 2 int HgEncoding(int coding) : coding: 3 int HgSetFont(hgfont font, double size) : font: size: 2: 3: HG_UTF8_CODE HG_JIS_CODE HG_SJIS_CODE HG_EUCJP_CODE UTF-8 JIS JIS EUC HG_T HG_TI HG_TB HG_TBI HG_H HG_HI HG_HB HG_HBI HG_C HG_CI HG_CB HG_CBI HG_M HG_MB HG_G HG_GB 5 5.1 HgLine() (x 0, y 0 ) (x 1, y 1 ) 4

int HgLine(double x0, double y0, double x1, double y1) : x0,y0: x1,y1: 5.2 int HgCircle(double x, double y, double r) : x,y: r: int HgCircleFill(double x, double y, double r, int stroke) : x,y: r: stroke: HgCircle() (x, y) r HgCircleFill() (x, y) r HgSet- PaintColor() stroke 0 0 1 r 0.0 5.3 int HgBox(double x, double y, double w, double h) : x,y: w,h: int HgBoxFill(double x, double y, double w, double h, int stroke) : x,y: w,h: stroke: HgBox() (x, y) w h HgBoxFill() (x, y) w h HgSetPaintColor() stroke 0 0 1 w 0.0, h 0.0 5.4 int HgText(double x, double y, const char *str,...) : x,y: str: 5

HgText() (x, y) str C printf() 5.5 int HgClear(void) 6 Handy Graphic 6.1 hgcolor (RGB) hgcolor HgGray(double g) : g: : hgcolor HgRGB(double r, double g, double b) : r: g: b: : HgGray() g 0.0 g 1.0 0.0 1.0 HgRGB() 0.0 x 1.0 r g b HgRGB(1.0, 0.0, 0.0) HgRGB(0.8, 0.8, 1.0) 6.2 HgLine() int HgMoveTo(double x, double y) : x,y: 6

int HgLineTo(double x, double y) : x,y: HgLine() (x 1, y 1 ) 6.3 int HgLines(int n, const double *xp, const double *yp) : n: xp,yp: x y n x y xp yp int HgPolygon(int n, const double *xp, const double *yp) : n: xp,yp: x y int HgPolygonFill(int n, const double *xp, const double *yp, int stroke) : n: xp,yp: x y stroke: HgPolygon() HgPolygonFill() stroke 0 6.4 int HgArc(double x, double y, double r, double a0, double a1) : x,y: r: a0: a1: HgArc() (x, y) r a0 a1 x 90 π/2 C 7

int HgFan(double x, double y, double r, double a0, double a1) : x,y: r: a0,a1: int HgFanFill(double x, double y, double r, double a0, double a1, int stroke) : x,y: r: a0,a1: stroke: HgFanFill() stroke 0 6.5 (0, 0) int HgCoordinate(double sx, double sy, double scale) : sx, sy: scale: sx, sy scale 2.0 0.5 1/2 1/10000 100000 6.6 PDF HgDisplayer int HgSave(const char *str) : str: str.pdf 8

7 7.1 HgOpen() Handy Graphic int HgWOpen(double x, double y, double w, double h) : x,y: w,h: : 0 : id -1: id id 0 HgWOpen() id 0 HgWOpen() void HgScreenSize(double *width, double *height) : width, height: width height 7.2 HgWOpen() id HgLine() HgWLine() HgWLine() id int HgLine(double x0, double y0, double x1, double y1) int HgWLine(int wid, double x0, double y0, double x1, double y1) Hg HgW id id id 0 9

7.3 int HgClose(void) HgWClose() HgCloseAll() int HgWClose(int wid) : wid: id void HgCloseAll(void) 7.4 HgDisplayer HgSetTitle() HgWSetTitle() str C printf() int HgSetTitle(const char *str,...) : str: int HgWSetTitle(int wid, const char *str,...) : wid: id str: 8 GUI Handy Graphic HgDisplayer 10

8.1 int HgGetChar(void) : 0 : -1: A a 97 A A 65 4 int HgWGetChar(int wid) : wid: id : 0 : -1: HgGetChar() HgWGetChar() HgGetChar() HgWGetChar() 8.2 HgEventMask() HgEvent() HgGetChar() HgWGetChar() 4: 5: HG_U_ARROW HG_MOUSE_DOWN HG_D_ARROW HG_KEY_DOWN HG_L_ARROW HG_R_ARROW 8.2 HgEventMask() HgWEventMask() int HgEventMask(unsigned int mask) : mask: 5 OR 11

HG_MOUSE_DOWN (HG_MOUSE_DOWN HG_KEY_DOWN) hgevent *HgEvent(void) : NULL: NULL : hgevent HgEventMask() NULL typedef struct { unsigned long type; /* */ int wid; /* id */ double x; /* (x, y) = */ double y; int count; unsigned int modkey; unsigned int ch; /* */ } hgevent; type 5 wid id (x, y) ch HgEventMask() 8.3 void HgTransWtoA(double wx, double wy, double *ax, double *ay) : wx, wy: ax, ay: void HgTransAtoW(double ax, double ay, double *wx, double *wy) : wx, wy: ax, ay: HgCoordinate() HgTransWtoA() HgTransAtoW() HgTransWtoA() 12

id HgWTransWtoA() HgWTransAtoW() 8.4 Handy Graphic 0.5 0.5 void msleep(double msec) : msec: 13

HgOpen(wd,hg) HgWOpen(x,y,wd,hg) 4.1,7.1 HgClose() HgWClose(w) 7.3 HgCloseAll() 7.3 HgSetTitle(str,...) HgWSetTitle(w,str,...) 7.4 HgScreenSize(wp,hp) 7.1 HgSetWidth(t) HgWSetWidth(w,t) 4.2 HgGray(g) 6.1 RGB HgRGB(r,g,b) 6.1 HgSetColor(c) HgWSetColor(w,c) 4.3 HgSetPaintColor(c) HgWSetPaintColor(w,c) 4.3 HgEncoding(code) 4.4 HgSetFont(f,sz) HgWSetFont(w,f,sz) 4.4 HgLine(x0,y0,x1,y1) HgWLine(w,x0,y0,x1,y1) 5.1 HgMoveTo(x,y) HgWMoveTo(w,x,y) 6.2 HgLineTo(x,y) HgWLineTo(w,x,y) 6.2 HgCircle(x,y,r) HgWCircle(w,x,y,r) 5.2 HgCircleFill(x,y,r,s) HgWCircleFill(w,x,y,r,s) 5.2 HgArc(x,y,r,a0,a1) HgWArc(w,x,y,r,a0,a1) 6.4 HgFan(x,y,r,a0,a1) HgWFan(w,x,y,r,a0,a1) 6.4 HgFanFill(x,y,r,a0,a1,s) HgWFanFill(w,x,y,r,a0,a1,s) 6.4 HgBox(x,y,wd,hg) HgWBox(w,x,y,wd,hg) 5.3 HgBoxFill(x,y,w,h,s) HgWBoxFill(w,x,y,wd,hg,s) 5.3 HgText(x,y,str,...) HgWText(w,x,y,str,...) 5.4 HgLines(n,x,y) HgWLines(w,n,x,y) 6.3 HgPolygon(n,x,y) HgWPolygon(w,n,x,y) 6.3 HgPolygonFill(n,x,y,s) HgWPolygonFill(w,n,x,y,s) 6.3 HgClear() HgWClear(w) 5.5 HgSave(file) HgWSave(w,file) 6.6 HgCoordinate(x,y,sc) HgWCoordinate(w,x,y,sc) 6.5 HgTransWtoA(wx,wy,ax,ay) HgWTransWtoA(w,wx,wy,ax,ay) 8.3 HgTransAtoW(ax,ay,wx,wy) HgWTransAtoW(w,ax,ay,wx,wy) 8.3 HgGetChar() HgWGetChar(w) 8.1 HgEventMask(m) HgWEventMask(w,m) 8.2 HgEvent() 8.2 14