コード例 #1
0
ファイル: HtmlLabel.cs プロジェクト: rajeshwarn/Creek
        /// <summary>
        /// Perform paint of the html in the control.
        /// </summary>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (_htmlContainer != null)
            {
                e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
                _htmlContainer.PerformPaint(e.Graphics);
            }
        }
コード例 #2
0
ファイル: HtmlPanel.cs プロジェクト: rajeshwarn/Creek
        /// <summary>
        /// Perform paint of the html in the control.
        /// </summary>
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (_htmlContainer != null)
            {
                _htmlContainer.ScrollOffset = AutoScrollPosition;
                _htmlContainer.PerformPaint(e.Graphics);

                // call mouse move to handle paint after scroll or html change affecting mouse cursor.
                Point mp = PointToClient(MousePosition);
                _htmlContainer.HandleMouseMove(this, new MouseEventArgs(MouseButtons.None, 0, mp.X, mp.Y, 0));
            }
        }
コード例 #3
0
ファイル: HtmlToolTip.cs プロジェクト: rajeshwarn/Creek
        /// <summary>
        /// Draw the html using the tooltip graphics.
        /// </summary>
        private void OnToolTipDraw(object sender, DrawToolTipEventArgs e)
        {
            if (_tooltipHandle == IntPtr.Zero)
            {
                // get the handle of the tooltip window using the graphics device context
                IntPtr hdc = e.Graphics.GetHdc();
                _tooltipHandle = Win32Utils.WindowFromDC(hdc);
                e.Graphics.ReleaseHdc(hdc);

                AdjustTooltipPosition(e.AssociatedControl, e.Bounds.Size);
            }

            e.Graphics.Clear(Color.White);
            _htmlContainer.PerformPaint(e.Graphics);
        }