iTextSharp.text.pdf.PdfContentByte.SetRGBColorStroke C# (CSharp) Метод

SetRGBColorStroke() публичный Метод

public SetRGBColorStroke ( int red, int green, int blue ) : void
red int
green int
blue int
Результат void
        public virtual void SetRGBColorStroke(int red, int green, int blue)
        {
            HelperRGB((float)(red & 0xFF) / 0xFF, (float)(green & 0xFF) / 0xFF, (float)(blue & 0xFF) / 0xFF);
            content.Append(" RG").Append_i(separator);
        }

Usage Example

Пример #1
0
	private void CreatePdfBox(PdfContentByte content, Configuration.PrintTemplateContentRow row, bool allowFill)
	{
		if (row.IsFillColorNull() && row.IsOutlineWidthNull() && row.IsOutlineColorNull())
		{
			return;
		}

		bool hasFill = false;
		bool hasStroke = false;

		content.SetLineWidth((1 / PixelsPerInch) * PointsPerInch);

		if (!row.IsFillColorNull() && allowFill)
		{
			System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml(row.FillColor);
			content.SetRGBColorFill(c.R, c.G, c.B);
			hasFill = true;
		}

		if (!row.IsOutlineWidthNull())
		{
			content.SetLineWidth((Convert.ToSingle(row.OutlineWidth) / PixelsPerInch) * PointsPerInch);
			hasStroke = true;
		}

		if (!row.IsOutlineColorNull())
		{
			System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml(row.OutlineColor);
			content.SetRGBColorStroke(c.R, c.G, c.B);
			hasStroke = true;
		}

		float originX = Convert.ToSingle(row.OriginX) * PointsPerInch;
		float originY = Convert.ToSingle(row.OriginY) * PointsPerInch;
		float width = Convert.ToSingle(row.Width) * PointsPerInch;
		float height = Convert.ToSingle(row.Height) * PointsPerInch;

		if (hasFill)
		{
			content.Rectangle(originX, originY, width, height);
			content.Fill();
		}

		if (hasStroke)
		{
			content.Rectangle(originX, originY, width, height);
			content.Stroke();
		}
	}
All Usage Examples Of iTextSharp.text.pdf.PdfContentByte::SetRGBColorStroke
PdfContentByte