Пример #1
0
        /// <summary>
        /// Updates the buffer in order to correctly re-draw this item, if it is on the page, and then invalidates
        /// the area where this will be drawn.
        /// </summary>
        /// <param name="item">The directory item to invalidate</param>
        public void RefreshItem(DirectoryItem item)
        {
            Graphics g = Graphics.FromImage(Page);
            Brush    b = new SolidBrush(item.BackColor);

            g.FillRectangle(b, DocumentToClient(item.Bounds));
            b.Dispose();

            // first translate into document coordinates
            Matrix mat = new Matrix();

            mat.Translate(ClientRectangle.X, ClientRectangle.Y);
            g.Transform = mat;

            item.Draw(new PaintEventArgs(g, item.Bounds));

            g.Dispose();
        }
Пример #2
0
        /// <summary>
        /// Updates the buffer in order to correctly re-draw this item, if it is on the page, and then invalidates
        /// the area where this will be drawn.
        /// </summary>
        /// <param name="item">The directory item to invalidate</param>
        public void RefreshItem(DirectoryItem item)
        {
            Graphics g = Graphics.FromImage(Page);
            Brush b = new SolidBrush(item.BackColor);
            g.FillRectangle(b, DocumentToClient(item.Bounds));
            b.Dispose();

            // first translate into document coordinates
            Matrix mat = new Matrix();
            mat.Translate(ClientRectangle.X, ClientRectangle.Y);
            g.Transform = mat;

            item.Draw(new PaintEventArgs(g, item.Bounds));

            g.Dispose();
        }