home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / palett.zip / PMGRAPH.CPP < prev    next >
C/C++ Source or Header  |  1994-08-31  |  1KB  |  55 lines

  1. // PMGRAPH.CPP - contains support functions for PM graphics
  2.  
  3. #define  INCL_PM
  4. #include <os2.h>
  5. #include <string.h>
  6.  
  7. VOID Line(HPS hps,int xstart,int ystart,int xend,int yend,long color)
  8. {
  9.     POINTL currpos,oppos;
  10.  
  11.     currpos.x=xstart;
  12.     currpos.y=ystart;
  13.     GpiMove(hps,&currpos);
  14.     oppos.x=xend;
  15.     oppos.y=yend;
  16.     GpiSetColor(hps,color);
  17.     GpiLine(hps,&oppos);
  18. }
  19.  
  20. VOID Box(HPS hps,int xstart,int ystart,int xend,int yend,long color)
  21. {
  22.     POINTL currpos,oppos;
  23.  
  24.     currpos.x=xstart;
  25.     currpos.y=ystart;
  26.     GpiMove(hps,&currpos);
  27.     oppos.x=xend;
  28.     oppos.y=yend;
  29.     GpiSetColor(hps,color);
  30.     GpiBox(hps,DRO_OUTLINEFILL,&oppos,0L,0L);
  31. }
  32.  
  33. VOID Text(HPS hps,int xstart,int ystart,char *string,long backcolor,long forecolor)
  34. {
  35.     POINTL ptlText;
  36.  
  37.     ptlText.x   = xstart;
  38.     ptlText.y   = ystart;
  39.     GpiSetBackColor(hps,backcolor);
  40.     GpiSetColor(hps,forecolor);
  41.     GpiCharStringAt(hps,&ptlText,strlen(string),string);
  42.  
  43. }
  44.  
  45. VOID Point(HPS hps,int x,int y,long color)
  46. {
  47.     POINTL ptlPoint;
  48.  
  49.     ptlPoint.x   = x;
  50.     ptlPoint.y   = y;
  51.     GpiSetColor(hps,color);
  52.     GpiSetPel(hps,&ptlPoint);
  53. }
  54.  
  55.