Beispiel #1
0
void
gfxContext::UpdateSurfaceClip()
{
    NewPath();
    // we paint an empty rectangle to ensure the clip is propagated to
    // the destination surface
    SetDeviceColor(gfxRGBA(0,0,0,0));
    Rectangle(gfxRect(0,1,1,0));
    Fill();
}
Beispiel #2
0
/*--- these functions are called only when print ----*/
void BuildImage(char *pImage,int XPos,int YPos,
            int Width,int Height,int Slant,int RotateAngle,int Color)
{
   LONG ImgByteOff,ThisLine;
   int  ImgBytesPerLine,x1,x2,y1,y2;
   int  bit,oldx,y,OX,OY;
   LPDC lpdc=&SysDc;

   OX=x1=XPos;      OY=y2=YPos;
   YPos-=Height-1;  y1=YPos;
   x2=XPos+Width-1;
/*----------------
   if((RotateAngle%360)!=0)
   {
      SetDeviceColor(Color,0);
      return;
   }
 -----------------------*/

   if (!PrintingSign||!GlobalRorate90)
   {
   if ((x1>=lpdc->right)||(x2<lpdc->left)) return;
   if ((y1>=lpdc->bottom)||(y2<lpdc->top)) return;
   if (x1<lpdc->left) x1=lpdc->left;
   if (x2>=lpdc->right) x2=lpdc->right-1;
   if(y1<lpdc->top) y1=lpdc->top;
   if(y2>=lpdc->bottom) y2=lpdc->bottom-1;
   }

   Slant%=360;

   SetDeviceColor(Color,1);
   XPos=x1;
   ImgBytesPerLine=(Width+7)/8;
   ThisLine=(y1-YPos)*ImgBytesPerLine;
   for(y=y1;y<=y2;y++)
   {
       ImgByteOff = ThisLine;
       x1=XPos;
      /*---- print one line ----*/
       while(x1<=x2)
       {
          oldx=x1;
          bit = (x1-XPos) & 7;
          while( x1<=x2 && (dot1tab[bit]&pImage[ImgByteOff]) )
          {
              x1++;
              bit++;
              if(bit==8) { bit=0; ImgByteOff++; }
          }

          if(x1>oldx)
          {             // line(oldx,y,x1-1,y)
      #define SLANT_DEBUG
            #ifdef SLANT_DEBUG
             int sx=oldx,ex=x1-1,yy;

             if(Slant)
             {
                 PointSkew(&sx,&yy,sx,y,OX,OY,-Slant);
                 //PointSkew(&sx,&yy,sx,y,OX,OY,-Slant);
                 ex=sx+(x1-1-oldx);
             }

             printer->printScanLine(sx,ex,y,lpdc);
            #else
             printer->printScanLine(oldx,x1-1,y,lpdc);
            #endif // SLANT_DEBUG
          }
          x1++;
          if( ((x1-XPos)&7)==0 ) ImgByteOff++;
       }

       ThisLine+=ImgBytesPerLine;        // point to next line
   } /*--- y ---*/
}