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

来自 , 2021-03-31, 写在 C, 查看 147 次.
URL http://www.code666.cn/view/ea119a40
  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 and 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 an error code */
  23.         }
  24.  
  25.         midx = getmaxx() / 2;
  26.         midy = getmaxy() / 2;
  27.  
  28.         /* loop through the fill patterns */
  29.         for ( i=SOLID_FILL; i<USER_FILL; i++ )
  30.         {
  31.                 /* set the fill style */
  32.                 setfillstyle ( i, getmaxcolor() );
  33.  
  34.                 /* draw the bar */
  35.                 bar ( midx-50, midy-50, midx+50,
  36.                       midy+50 );
  37.  
  38.                 getch();
  39.         }
  40.  
  41.         /* clean up */
  42.         closegraph();
  43.         return 0;
  44. }

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

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

captcha