文書番号: 401978
最終更新日: 1999/08/19
第 12 章 確認されているランタイムライブラリの不具合
int rtn; _setvideomode( _MAXRESMODE ); _setcolor( 7 ); _setwritemode( _GXOR ); rtn = _ellipse( _GBORDER, 100, 100, 200, 200); getch(); _setvideomode( _DEFAULTMODE );}
例 // cl option needs /AH #define ELM 32 #define TBL ((0xffff / ELM) + 1) //char tbl_key[TBL][ELM]; struct table{char key[ELM];}tbl_key[TBL]; // <- Modified int cmpf(const void *c1,const void *c2); void main(void) { ... qsort(&tbl_key,TBL,ELM,cmpf); } int cmpf(const void *c1,const void *c2) { return strcmp((struct table*)c1, (struct table*)c2);// <- Modified } //EOF
例 struct _xycoord p[4]; ... p[0].xcoord = 0; p[0].ycoord = 0; p[1].xcoord = 0; p[1].ycoord = 1; p[2].xcoord = 100; p[2].ycoord = 1; p[3].xcoord = 100; p[3].ycoord = 0; _polygon (_GFILLINTERIOR, p, 4) _ellipse(_GFILLINTERIOR,,,) の動作 _ellipse 関数で塗り潰し (_GFILLINTERIOR) を行う時に同色の背景色で塗り潰した場 合に、完全に塗り潰しを行いません。 .//Test Program ... _setcolor(1); _ellipse(_GFILLINTERIOR, 100, 100, 400, 400 ); _setcolor(2); _moveto(150, 150); _lineto(350, 150); printf("「線」を描画しました・n"); PrnSts_KeyWait(); _setcolor(1); /* 次の _ellipse が正常に表示されない(_lineto で描画した線が残る) */ _ellipse(_GFILLINTERIOR, 100, 100, 400, 400 );
例 #include <stdio.h> #include <graph.h> #include <conio.h> void main( void ) { _setvideomode(_VRES16COLOR); _clearscreen(_GCLEARSCREEN); _setbkcolor(_BLUE); /* 問題の関数 */ _setcolor(3); /* 検証の為、最大範囲で */ _rectangle(_GBORDER,0,0,639,479); /* 色を変えて枠を書く */ getch(); _setvideomode(_TEXTC80); }
例 #include <CONIO.H> #include <GRAPH.H> #include <PGCHART.H> #define TEAMS 2 #define MONTHS 3 float __far values[TEAMS][MONTHS] = { { .999F, .999F, .671F }, { .533F, .533F, .401F } }; char __far *months[ MONTHS ] = { "May", "June", "July" }; char __far *teams [ TEAMS ] = { "Cubs", "Reds" }; void main( void ) { chartenv env; _setvideomode( _MAXRESMODE ); _pg_initchart(); _pg_defaultchart( &env, _PG_LINECHART, _PG_POINTANDLINE ); env.datawindow.border = 0; _pg_chartms( &env, months, ( float __far * )values, TEAMS, MONTHS, MONTHS, teams ); getch(); _setvideomode( _DEFAULTMODE ); }
env.yaxis.autoscale env.yaxis.scalemin env.yaxis.scalemax env.yaxis.scalefactor env.yaxis.ticinterval env.yaxis.ticformat env.yaxis.ticdecimals直接必要なのは、x軸を定義する _axistype 構造体の scalemax 変数ですが、
例 /* options nothing or /Op */ #include <MATH.H> #include <STDIO.H> #define PI 3.141592653589793 void main( void ) { double theta, t1, t2; int i; for( i = -9; i <= 36; i++ ) { t1 = cos( theta = (double)i * PI / 18.0 ); t2 = tan( 22.0 * PI / 180.0 ); printf( "\ni = %3d theta = %6.3lf t1 = %6.3lf t2 = %6.3lf", i, theta, t1, t2 ); } }
sin()/cos() に書き直す必要があります。
#include <stdio.h> #include <conio.h> #include <graph.h> void main( void ) { _getch(); _setvideomode( _98RESS16COLOR ); _remappalette( 0, _98BLUE ); _getch(); _setvideomode( _DEFAULTMODE ); }
例 #include <stdio.h> #include <conio.h> #include <graph.h> void main( void ) { _setvideomode( _98RESS16COLOR ); _setcolor( 7 ); _getch(); _setwritemode( _GXOR ); _moveto( 260, 74 ); _lineto( 498, 288 ); _getch(); _setcolor( 4 ); _setwritemode( _GPSET ); _moveto( 260, 74 ); _lineto( 498, 288 ); _getch(); _setvideomode( _DEFAULTMODE ); }
#include <STDIO.H> #include <GRAPH.H> #include <CONIO.H> #include <STDLIB.H> void main( int argc, char *argv[] ) { int WIDTH; int x, y, ofs, color; int fillx, filly; WIDTH = atoi( argv[1] ); WIDTH = (WIDTH<=0) ? 5 : WIDTH; printf("%d", WIDTH ); _setvideomode( _98RESS16COLOR ); _rectangle( _GBORDER, 1, 1, 638, 398 ); ofs = 0; for( y = 0; y < 398; y+=WIDTH ) for( ofs = 0; ofs < (WIDTH*WIDTH); ofs+=WIDTH ) for( x = ofs; x < 639; x+=WIDTH ) _setpixel( (short)x, (short)y ); color = _setcolor( 4 ); fillx = 77; filly = 77; if( fillx % WIDTH == 0 ) fillx++; if( filly % WIDTH == 0 ) filly++; _floodfill( (short)fillx, (short)filly, (short)color ); _getch(); _setvideomode( _DEFAULTMODE ); }
例 #include <GRAPH.H> #include <CONIO.H> void main( void ) { _setvideomode( _98RESS16COLOR ); _setcolor( 3 ); _moveto( 50, 50 ); _lineto( 100, 100 ); _moveto( 0, 0 ); _lineto( 639, 399 ); _getch(); _setwritemode( _GXOR ); _moveto( 50 , 50 ); _lineto( 100, 100 ); _moveto( 0, 0 ); _lineto( 639, 399 ); _getch(); _setvideomode( _DEFAULTMODE ); }
Keywords: KBINFO VC15 KB401978
Technology: kbAudDeveloper kbvc150 kbVCsearch