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

void PoDoFo::PdfPainter::SetStrokingColor ( const PdfColor rColor ) [inherited]

Set the color for all following stroking operations.

Parameters:
rColora PdfColor object

Definition at line 242 of file PdfPainter.cpp.

References PoDoFo::PdfCanvas::AddColorResource(), PoDoFo::PdfStream::Append(), PoDoFo::ePdfColorSpace_CieLab, PoDoFo::ePdfColorSpace_DeviceCMYK, PoDoFo::ePdfColorSpace_DeviceGray, PoDoFo::ePdfColorSpace_DeviceRGB, PoDoFo::ePdfColorSpace_Separation, PoDoFo::PdfColor::GetBlack(), PoDoFo::PdfColor::GetBlue(), PoDoFo::PdfColor::GetCieA(), PoDoFo::PdfColor::GetCieB(), PoDoFo::PdfColor::GetCieL(), PoDoFo::PdfColor::GetColorSpace(), PoDoFo::PdfColor::GetCyan(), PoDoFo::PdfColor::GetDensity(), PoDoFo::PdfColor::GetGrayScale(), PoDoFo::PdfColor::GetGreen(), PoDoFo::PdfColor::GetMagenta(), PoDoFo::PdfColor::GetName(), PoDoFo::PdfColor::GetRed(), PoDoFo::PdfColor::GetYellow(), PoDoFo::PdfPainter::m_oss, PoDoFo::PdfPainter::m_pCanvas, PoDoFo::PdfPainter::m_pPage, and PODOFO_RAISE_LOGIC_IF.

{
    PODOFO_RAISE_LOGIC_IF( !m_pCanvas, "Call SetPage() first before doing drawing operations." );    

    m_oss.str("");

    switch( rColor.GetColorSpace() ) 
    {
        default: 
        case ePdfColorSpace_DeviceRGB:
            m_oss << rColor.GetRed()   << " "
                  << rColor.GetGreen() << " "
                  << rColor.GetBlue() 
                  << " RG" << std::endl;
            break;
        case ePdfColorSpace_DeviceCMYK:
            m_oss << rColor.GetCyan()    << " " 
                  << rColor.GetMagenta() << " " 
                  << rColor.GetYellow()  << " " 
                  << rColor.GetBlack() 
                  << " K" << std::endl;
            break;
        case ePdfColorSpace_DeviceGray:
            m_oss << rColor.GetGrayScale() << " G" << std::endl;
            break;
        case ePdfColorSpace_Separation:
                  m_pPage->AddColorResource( rColor );
                  m_oss << "/ColorSpace" << PdfName( rColor.GetName() ).GetEscapedName() << " CS " << rColor.GetDensity() << " SCN" << std::endl;
            break;
        case ePdfColorSpace_CieLab:
                  m_pPage->AddColorResource( rColor );
                  m_oss << "/ColorSpaceCieLab" << " CS " 
                          << rColor.GetCieL() << " " 
                  << rColor.GetCieA() << " " 
                  << rColor.GetCieB() <<
                          " SCN" << std::endl;
            break;
    }

    m_pCanvas->Append( m_oss.str() );
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index