本文整理匯總了C#中iTextSharp.text.pdf.PdfPatternPainter.IsStencil方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPatternPainter.IsStencil方法的具體用法?C# PdfPatternPainter.IsStencil怎麽用?C# PdfPatternPainter.IsStencil使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPatternPainter
的用法示例。
在下文中一共展示了PdfPatternPainter.IsStencil方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetPatternStroke
/** Sets the stroke color to a pattern. The pattern can be
* colored or uncolored.
* @param p the pattern
*/
public virtual void SetPatternStroke(PdfPatternPainter p)
{
if (p.IsStencil()) {
SetPatternStroke(p, p.DefaultColor);
return;
}
CheckWriter();
PageResources prs = PageResources;
PdfName name = writer.AddSimplePattern(p);
name = prs.AddPattern(name, p.IndirectReference);
content.Append(PdfName.PATTERN.GetBytes()).Append(" CS ").Append(name.GetBytes()).Append(" SCN").Append_i(separator);
}
示例2: SetPatternFill
/** Sets the fill color to an uncolored pattern.
* @param p the pattern
* @param color the color of the pattern
* @param tint the tint if the color is a spot color, ignored otherwise
*/
public virtual void SetPatternFill(PdfPatternPainter p, Color color, float tint)
{
CheckWriter();
if (!p.IsStencil())
throw new Exception("An uncolored pattern was expected.");
PageResources prs = PageResources;
PdfName name = writer.AddSimplePattern(p);
name = prs.AddPattern(name, p.IndirectReference);
ColorDetails csDetail = writer.AddSimplePatternColorspace(color);
PdfName cName = prs.AddColor(csDetail.ColorName, csDetail.IndirectReference);
content.Append(cName.GetBytes()).Append(" cs").Append_i(separator);
OutputColorNumbers(color, tint);
content.Append(' ').Append(name.GetBytes()).Append(" scn").Append_i(separator);
}