home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / vifs / gputs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-06  |  731 b   |  38 lines

  1. /*
  2.  *    gputs.c  -- print a string in graphic mode
  3.  *
  4.  *    8 may  1989  Olle
  5.  */
  6.  
  7. #include <graphics.h>
  8.  
  9.  
  10. void gputs( register char *string )
  11. {
  12. int chw, chh;
  13. struct fillsettingstype fis;
  14.  
  15. /* print a string in graphic mode */
  16. /* assume TOP_TEXT & LEFT_TEXT justification */
  17.  
  18. /* get string size for erase */
  19. chw = textwidth( string );
  20. chh = textheight( string );
  21.  
  22. /* get fill settings */
  23. getfillsettings( &fis );
  24.  
  25. /* setup for character erase */
  26. setfillstyle( SOLID_FILL, getbkcolor() );
  27.  
  28. /* fill with the background color */
  29. bar( getx(), gety(), getx() + chw - 1, gety() + chh - 1 );
  30.  
  31. /* print the string */
  32. outtext( string );
  33.  
  34. /* restore fill settings */
  35. setfillstyle( fis.pattern, fis.color );
  36. }
  37.  
  38.