Beispiel #1
0
        protected void ProcessSetClipRect(IEnumerable <string> arguments)
        {
            int left = int.Parse(arguments.First());

            arguments = arguments.Skip(1);

            int top = int.Parse(arguments.First());

            arguments = arguments.Skip(1);

            int right = int.Parse(arguments.First());

            arguments = arguments.Skip(1);

            int bottom = int.Parse(arguments.First());

            arguments = arguments.Skip(1);

            Rect r = new Rect(left, top, right, bottom);

            m_vwGraphics32.SetClipRect(ref r);
        }
Beispiel #2
0
        public void SetClipRect()
        {
            IVwGraphicsWin32 vwGraphics = VwGraphicsWin32Class.Create();

            Assert.IsNotNull(vwGraphics);

            using (var gr = new GraphicsObjectFromImage())
            {
                vwGraphics.Initialize(gr.Graphics.GetHdc());

                int left, top, right, bottom;

                var rect = new Utils.Rect(50, 25, 1000, 1000);
                vwGraphics.SetClipRect(ref rect);
                vwGraphics.GetClipRect(out left, out top, out right, out bottom);

                Assert.AreEqual(50, left, "Left doesn't match");
                Assert.AreEqual(25, top, "Top doesn't match");
                Assert.AreEqual(1000, right, "Right doesn't match");
                Assert.AreEqual(1000, bottom, "Bottom doesn't match");
            }
        }