Пример #1
0
        public void CreatePaintWindow(Rectangle rect)
        {
//      Trace.WriteLine("CreatePaintWindow: " + callStack);
            GdiWindow parent = null;

            if (_windows.Count > 0)
            {
                parent = this._windows.Peek();
            }

            Rectangle frect = rect;

            if (parent != null)
            {
                Rectangle prect = parent.WinRect;
                frect.X += prect.X;
                frect.Y += prect.Y;
            }

            this.SetViewport(frect);
            IntPtr rgn = this.SaveClip(frect);

            this.IntersectClipRect(0, 0, frect.Width, frect.Height);
            this._windows.Push(new GdiWindow(frect, rgn));
        }
Пример #2
0
        public void RestorePaintWindow()
        {
            // Trace.WriteLine("RestorePaintWindow: " + callStack);
            if (_windows.Count == 0)
            {
                return;
            }
            GdiWindow current = this._windows.Pop();

            this.RestoreClip(current.Region);

            Rectangle frect = new Rectangle(0, 0, this._winWidht, this._winHeight);

            if (_windows.Count > 0)
            {
                current = this._windows.Peek();
                frect   = current.WinRect;
            }
            this.SetViewport(frect);
        }