home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / WWWCNT15.ARJ / WWWCNT15 / WWWCNT15.ZIP / combine / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-09  |  1.1 KB  |  60 lines

  1. #include "combine.h"
  2. #include "defines.h"
  3. #include "gdfonts.h"
  4.  
  5. void main(argc,argv)
  6. int
  7.     argc;
  8. char
  9.     *argv[];
  10. {
  11.     Image
  12.         *fimage,
  13.         *image;
  14.  
  15.     int
  16.         i,
  17.         j,
  18.         k,
  19.         x,
  20.         y,
  21.         z;
  22.     char
  23.         string[100];
  24.  
  25.     FrameInfo
  26.         frame_info;
  27.  
  28.     SFontInfo
  29.         font_info;
  30.  
  31.     (void) strcpy(string, argv[1]);
  32.  
  33.     image=CreateBaseImage(gdFontSmall->w*(int)strlen(string)+2,
  34.         gdFontSmall->h+2,0,0,0,DirectClass);
  35.     if (image == (Image *) NULL)
  36.     {
  37.         (void) fprintf (stderr,"Failed to create base image!\n");
  38.         exit(1);
  39.     }
  40.  
  41.     font_info.do_bg=True;
  42.     font_info.bgr=0;
  43.     font_info.bgg=0;
  44.     font_info.bgb=0;
  45.  
  46.     font_info.fgr=255;
  47.     font_info.fgg=255;
  48.     font_info.fgb=0;
  49.  
  50.     ImageString(image,gdFontSmall,1,1,string,&font_info);
  51.     GetFrameInfo(image->columns,image->rows,&frame_info);
  52.     fimage=FrameImage(image,&frame_info);
  53.     if (fimage != (Image *) NULL)
  54.     {
  55.         DestroyAnyImageStruct(&image);
  56.         image=fimage;
  57.     }
  58.     (void) WriteGIFImage (image,(char *) NULL);
  59. }
  60.