Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void wxPdfDocument::ClippingPath ( const wxPdfShape shape,
int  style = wxPDF_STYLE_NOOP 
) [virtual]

Define clipping area using a shape.

A clipping area restricts the display and prevents any elements from showing outside of it.

Parameters:
shapeshape defining the clipping path
styleStyle of rendering. Possible values are:

  • wxPDF_STYLE_NOOP (default)
  • wxPDF_STYLE_DRAW: draw the outline of the clipping path
  • wxPDF_STYLE_FILL: fill the area enclosed by the clipping path
  • wxPDF_STYLE_FILLDRAW: draw and fill

Definition at line 1529 of file pdfgraphics.cpp.

References ClippingPath(), ClosePath(), CurveTo(), wxPdfShape::GetSegment(), wxPdfShape::GetSegmentCount(), LineTo(), and MoveTo().

{
  ClippingPath();
  double scratch[6];
  int iterType;
  int iterPoints = 0;
  int segCount = shape.GetSegmentCount();
  for (iterType = 0; iterType < segCount; iterType++)
  {
    int segType = shape.GetSegment(iterType, iterPoints, scratch);
    switch (segType)
    {
      case wxPDF_SEG_CLOSE:
        iterPoints++;
        break;
      case wxPDF_SEG_MOVETO:
        MoveTo(scratch[0], scratch[1]);
        iterPoints++;
        break;
      case wxPDF_SEG_LINETO:
        LineTo(scratch[0], scratch[1]);
        iterPoints++;
        break;
      case wxPDF_SEG_CURVETO:
        CurveTo(scratch[0], scratch[1], scratch[2], scratch[3],scratch[4], scratch[5]);
        iterPoints += 3;
        break;
    }
  }
  ClosePath(style);
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index