當前位置: 首頁>>代碼示例>>C#>>正文


C# Drawing.XUnit類代碼示例

本文整理匯總了C#中PdfSharp.Drawing.XUnit的典型用法代碼示例。如果您正苦於以下問題:C# XUnit類的具體用法?C# XUnit怎麽用?C# XUnit使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XUnit類屬於PdfSharp.Drawing命名空間,在下文中一共展示了XUnit類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: NewPage

 public static XGraphics NewPage(PdfDocument document, XUnit width, XUnit height)
 {
     var page = document.AddPage();
     page.Width = width;
     page.Height = height;
     return XGraphics.FromPdfPage(page);
 }
開發者ID:JBonsink,項目名稱:BaxterLicence,代碼行數:7,代碼來源:PdfRendering.cs

示例2: Render

        internal void Render(XUnit x, XUnit y, XUnit width, XUnit height)
        {
            if (_shading == null || _brush == null)
                return;

            _gfx.DrawRectangle(_brush, x.Point, y.Point, width.Point, height.Point);
        }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:7,代碼來源:ShadingRenderer.cs

示例3: MarginMax

 /// <summary>
 /// Returns the max of the given Margins, if both are positive or 0, the sum otherwise.
 /// </summary>
 /// <param name="prevBottomMargin">The bottom margin of the previous element.</param>
 /// <param name="nextTopMargin">The top margin of the next element.</param>
 /// <returns></returns>
 private XUnit MarginMax(XUnit prevBottomMargin, XUnit nextTopMargin)
 {
     if (prevBottomMargin >= 0 && nextTopMargin >= 0)
         return Math.Max(prevBottomMargin, nextTopMargin);
     else
         return prevBottomMargin + nextTopMargin;
 }
開發者ID:GorelH,項目名稱:PdfSharp,代碼行數:13,代碼來源:TopDownFormatter.cs

示例4: Cell

 public Cell(string text, XUnit width, XFont font, Alignment alignment)
 {
     this.Text = text;
     this.width = width;
     this.font = font;
     this.alignment = alignment;
     this.height = XUnit.Zero;
 }
開發者ID:JBonsink,項目名稱:BaxterLicence,代碼行數:8,代碼來源:PdfTable.cs

示例5: PDFLayoutHelper

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="document">Pdf Document object</param>
 /// <param name="topPosition">Top positon for the PDF write start position</param>
 /// <param name="bottomMargin">Bottom margin for the PDF</param>
 public PDFLayoutHelper(PdfDocument document, XUnit topPosition, XUnit bottomMargin)
 {
     _document = document;
     _topPosition = topPosition;
     _bottomMargin = bottomMargin;
     // Set a value outside the page - a new page will be created on the first request.
     _currentPosition = bottomMargin + 10000;
 }
開發者ID:sachinnair90,項目名稱:Sachin_Nair,代碼行數:14,代碼來源:PDFLayoutHelper.cs

示例6: Render

 internal void Render(XUnit xPosition, XUnit yPosition, XUnit width, XUnit height)
 {
     XUnit lineWidth = GetWidth();
     if (lineWidth > 0)
     {
         XPen pen = GetPen(lineWidth);
         _gfx.DrawRectangle(pen, xPosition, yPosition, width, height);
     }
 }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:9,代碼來源:LineFormatRenderer.cs

示例7: FormattedCell

 internal FormattedCell(Cell cell, DocumentRenderer documentRenderer, Borders cellBorders, FieldInfos fieldInfos, XUnit xOffset, XUnit yOffset)
 {
   this.cell = cell;
   this.fieldInfos = fieldInfos;
   this.yOffset = yOffset;
   this.xOffset = xOffset;
   this.bordersRenderer = new BordersRenderer(cellBorders, null);
   this.documentRenderer = documentRenderer;
 }
開發者ID:GorelH,項目名稱:PdfSharp,代碼行數:9,代碼來源:FormattedCell.cs

示例8: Render

    internal void Render(XUnit x, XUnit y, XUnit width, XUnit height)
    {
      XBrush brush = GetBrush();

      if (brush == null)
        return;

      this.gfx.DrawRectangle(brush, x.Point, y.Point, width.Point, height.Point);
    }
開發者ID:GorelH,項目名稱:PdfSharp,代碼行數:9,代碼來源:FillFormatRenderer.cs

示例9: FormattedCell

 internal FormattedCell(Cell cell, DocumentRenderer documentRenderer, Borders cellBorders, FieldInfos fieldInfos, XUnit xOffset, XUnit yOffset)
 {
     _cell = cell;
     _fieldInfos = fieldInfos;
     _yOffset = yOffset;
     _xOffset = xOffset;
     _bordersRenderer = new BordersRenderer(cellBorders, null);
     _documentRenderer = documentRenderer;
 }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:9,代碼來源:FormattedCell.cs

示例10: GetLinePosition

        /// <summary>
        /// Get line positon for current write position
        /// </summary>
        /// <param name="requestedHeight">Requested height for next line</param>
        /// <param name="requiredHeight">Required height for next line</param>
        /// <returns></returns>
        public XUnit GetLinePosition(XUnit requestedHeight, XUnit requiredHeight)
        {
            XUnit required = requiredHeight == -1f ? requestedHeight : requiredHeight;

            // Check if new line position will exceed the page limit, if then create a new page
            if (_currentPosition + required > _bottomMargin)
                CreatePage();

            XUnit result = _currentPosition;
            _currentPosition += requestedHeight;
            return result;
        }
開發者ID:sachinnair90,項目名稱:Sachin_Nair,代碼行數:18,代碼來源:PDFLayoutHelper.cs

示例11: GetFormattedTextArea

        FormattedTextArea GetFormattedTextArea(TextArea area, XUnit width)
        {
            if (area == null)
                return null;

            FormattedTextArea formattedTextArea = new FormattedTextArea(_documentRenderer, area, _fieldInfos);

            if (!double.IsNaN(width))
                formattedTextArea.InnerWidth = width;

            formattedTextArea.Format(_gfx);
            return formattedTextArea;
        }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:13,代碼來源:ChartRenderer.cs

示例12: GetLeftRightVerticalPosition

        void GetLeftRightVerticalPosition(out XUnit top, out XUnit bottom)
        {
            //REM: Line width is still ignored while layouting charts.
            Area contentArea = _renderInfo.LayoutInfo.ContentArea;
            ChartFormatInfo formatInfo = (ChartFormatInfo)_renderInfo.FormatInfo;
            top = contentArea.Y;

            if (formatInfo.FormattedHeader != null)
                top += formatInfo.FormattedHeader.InnerHeight;

            bottom = contentArea.Y + contentArea.Height;
            if (formatInfo.FormattedFooter != null)
                bottom -= formatInfo.FormattedFooter.InnerHeight;
        }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:14,代碼來源:ChartRenderer.cs

示例13: RenderByInfos

        /// <summary>
        /// Renders the contents shifted to the given Coordinates.
        /// </summary>
        /// <param name="xShift">The x shift.</param>
        /// <param name="yShift">The y shift.</param>
        /// <param name="renderInfos">The render infos.</param>
        protected void RenderByInfos(XUnit xShift, XUnit yShift, RenderInfo[] renderInfos)
        {
            if (renderInfos == null)
                return;

            foreach (RenderInfo renderInfo in renderInfos)
            {
                XUnit savedX = renderInfo.LayoutInfo.ContentArea.X;
                XUnit savedY = renderInfo.LayoutInfo.ContentArea.Y;
                renderInfo.LayoutInfo.ContentArea.X += xShift;
                renderInfo.LayoutInfo.ContentArea.Y += yShift;
                Renderer renderer = Create(_gfx, _documentRenderer, renderInfo, _fieldInfos);
                renderer.Render();
                renderInfo.LayoutInfo.ContentArea.X = savedX;
                renderInfo.LayoutInfo.ContentArea.Y = savedY;
            }
        }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:23,代碼來源:Renderer.cs

示例14: GetPen

        XPen GetPen(XUnit width)
        {
            if (width == 0)
                return null;

            XPen pen = new XPen(GetColor(), width);
            switch (_lineFormat.DashStyle)
            {
                case DashStyle.Dash:
                    pen.DashStyle = XDashStyle.Dash;
                    break;

                case DashStyle.DashDot:
                    pen.DashStyle = XDashStyle.DashDot;
                    break;

                case DashStyle.DashDotDot:
                    pen.DashStyle = XDashStyle.DashDotDot;
                    break;

                case DashStyle.Solid:
                    pen.DashStyle = XDashStyle.Solid;
                    break;

                case DashStyle.SquareDot:
                    pen.DashStyle = XDashStyle.Dot;
                    break;
            }
            return pen;
        }
開發者ID:Sl0vi,項目名稱:MigraDoc,代碼行數:30,代碼來源:LineFormatRenderer.cs

示例15: SaveBeforeProbing

 void SaveBeforeProbing(out ParagraphIterator paragraphIter, out int blankCount, out XUnit wordsWidth, out XUnit xPosition, out XUnit lineWidth, out XUnit blankWidth)
 {
   paragraphIter = this.currentLeaf;
   blankCount = this.currentBlankCount;
   xPosition = this.currentXPosition;
   lineWidth = this.currentLineWidth;
   wordsWidth = this.currentWordsWidth;
   blankWidth = this.savedBlankWidth;
 }
開發者ID:DavidS,項目名稱:MigraDoc,代碼行數:9,代碼來源:ParagraphRenderer.cs


注:本文中的PdfSharp.Drawing.XUnit類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。