示例#1
0
        //将初始矩形的坐标投影到当前画布状态
        private OECPVertex I2C(OECPVertex vtx)
        {
            var t           = (OECPVertex)vtx.Clone();;
            var w2dw1       = _square.Width / _dSquare.Width;
            var cUnitVector = new PointF(_dSquare.Location.X - vtx.X, _dSquare.Location.Y - vtx.Y);
            var x0          = _square.Location.X - cUnitVector.X * w2dw1;
            var y0          = _square.Location.Y - cUnitVector.Y * w2dw1;

            t.X = x0;
            t.Y = y0;
            return(t);
        }
示例#2
0
        //获得初始正方形上对应的点
        private OECPVertex C2I(OECPVertex vtx)
        {
            var tVtx        = (OECPVertex)vtx.Clone();
            var w2dw1       = _square.Width / _dSquare.Width;
            var cUnitVector = new PointF(_square.Location.X - vtx.X, _square.Location.Y - vtx.Y);
            var x0          = _dSquare.Location.X - cUnitVector.X / w2dw1;
            var y0          = _dSquare.Location.Y - cUnitVector.Y / w2dw1;

            tVtx.X = x0;
            tVtx.Y = y0;
            return(tVtx);
        }