Пример #1
0
        public void Draw(PdfRenderer renderer, Graphics graphics)
        {
            if (renderer == null)
            {
                throw new ArgumentNullException(nameof(renderer));
            }
            if (graphics == null)
            {
                throw new ArgumentNullException(nameof(graphics));
            }

            var bounds = renderer.BoundsFromPdf(new PdfRectangle(Page, Bounds));

            using (var brush = new SolidBrush(Color))
            {
                graphics.FillRectangle(brush, bounds);
            }

            if (BorderWidth > 0)
            {
                using (var pen = new Pen(BorderColor, BorderWidth))
                {
                    graphics.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width, bounds.Height);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Creates a new instance of the search manager.
        /// </summary>
        /// <param name="renderer">The renderer to create the search manager for.</param>
        public PdfSearchManager(PdfRenderer renderer)
        {
            if (renderer == null)
            {
                throw new ArgumentNullException(nameof(renderer));
            }

            Renderer = renderer;

            HighlightAllMatches = true;
            MatchColor          = Color.FromArgb(0x80, Color.Yellow);
            CurrentMatchColor   = Color.FromArgb(0x80, SystemColors.Highlight);
        }