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

void wxPdfDocument::SetFillGradient ( double  x,
double  y,
double  w,
double  h,
int  gradient 
) [virtual]

Paints a gradient shading to rectangular area.

Parameters:
xabscissa of the top left corner of the rectangle.
yordinate of the top left corner of the rectangle.
wwidth of the rectangle.
hheight of the rectangle.
gradientid of the gradient.

Definition at line 2343 of file pdfkernel.cpp.

References ClippingRect(), m_h, m_k, Out(), OutAscii(), and Transform().

{
  if (gradient > 0 && (size_t) gradient <= (*m_gradients).size())
  {
    ClippingRect(x, y, w, h, false);
    //set up transformation matrix for gradient
    double tm[6];
    tm[0] = w * m_k;
    tm[1] = 0;
    tm[2] = 0;
    tm[3] = h * m_k;
    tm[4] = x * m_k;
    tm[5] = (m_h - (y+h)) * m_k;
    Transform(tm);
    // paint the gradient
    OutAscii(wxString::Format(_T("/Sh%d sh"), gradient));
    // restore previous Graphic State
    Out("Q");
  }
  else
  {
    wxLogError(_("wxPdfDocument::SetFillGradient: Gradient Id out of range."));
  }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index