[C] 画一个三维条形码 →→→→→进入此内容的聊天室

来自 , 2020-10-21, 写在 C, 查看 104 次.
URL http://www.code666.cn/view/6832a7b2
  1. #include <graphics.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. int main ( void )
  7. {
  8.         /* request auto detection */
  9.         int gdriver = DETECT, gmode, errorcode;
  10.         int midx, midy, i;
  11.  
  12.         /* initialize graphics, local variables */
  13.         initgraph ( &gdriver, &gmode, "" );
  14.  
  15.         /* read result of initialization */
  16.         errorcode = graphresult();
  17.         if ( errorcode != grOk )  /* an error occurred */
  18.         {
  19.                 printf ( "Graphics error: %s\n", grapherrormsg ( errorcode ) );
  20.                 printf ( "Press any key to halt:" );
  21.                 getch();
  22.                 exit ( 1 ); /* terminate with error code */
  23.         }
  24.  
  25.         midx = getmaxx() / 2;
  26.         midy = getmaxy() / 2;
  27.  
  28.         /* loop through the fill patterns */
  29.         for ( i=EMPTY_FILL; i<USER_FILL; i++ )
  30.         {
  31.                 /* set the fill style */
  32.                 setfillstyle ( i, getmaxcolor() );
  33.  
  34.                 /* draw the 3-d bar */
  35.                 bar3d ( midx-50, midy-50, midx+50, midy+50, 10, 1 );
  36.  
  37.                 getch();
  38.         }
  39.  
  40.         /* clean up */
  41.         closegraph();
  42.         return 0;
  43. }

回复 "画一个三维条形码"

这儿你可以回复上面这条便签

captcha