Beispiel #1
0
        public void DotToLogicLength(Point point, ref Vector realPos, GuideOrientation orientation)
        {
            if ((orientation == GuideOrientation.Horizontal) ||
                (orientation == GuideOrientation.Diagonal))
            {
                if (Resolution.Y > 0)
                {
                    realPos.Y = ((double)(point.Y)) * Resolution.Y;
                }
                else
                {
                    realPos.Y = 0;
                }
            }

            if ((orientation == GuideOrientation.Vertical) ||
                (orientation == GuideOrientation.Diagonal))
            {
                if (Resolution.X > 0)
                {
                    realPos.X = ((double)(point.X)) * Resolution.X;
                }
                else
                {
                    realPos.X = 0;
                }
            }
        }
Beispiel #2
0
        public void LogicToDot(ref Point point, Vector RealPos, GuideOrientation nTyp)
        {
            if (nTyp == GuideOrientation.Horizontal || nTyp == GuideOrientation.Diagonal)
            {
                if (Resolution.Y > 0)
                {
                    _PixelTemp = (RealPos.Y - Origin.Y) / Resolution.Y;
                    point.Y    = RoundUp(_PixelTemp);
                }
                else
                {
                    point.Y = 0;
                }
            }

            if (nTyp == GuideOrientation.Vertical || nTyp == GuideOrientation.Diagonal)
            {
                if (Resolution.X > 0)
                {
                    _PixelTemp = (RealPos.X - Origin.X) / Resolution.X;
                    point.X    = RoundUp(_PixelTemp);
                }
                else
                {
                    point.X = 0;
                }
            }
        }
Beispiel #3
0
        public void LogicToDot(ref double ptX, ref double ptY, double realPosX, double realPosY, GuideOrientation nTyp)
        {
            if (nTyp == GuideOrientation.Horizontal || nTyp == GuideOrientation.Diagonal)
            {
                if (Resolution.Y > 0)
                {
                    _PixelTemp = (realPosY - Origin.Y) / Resolution.Y;
                    ptY        = RoundUp(_PixelTemp);
                }
                else
                {
                    ptY = 0;
                }
            }

            if (nTyp == GuideOrientation.Vertical || nTyp == GuideOrientation.Diagonal)
            {
                if (Resolution.X > 0)
                {
                    _PixelTemp = (realPosX - Origin.X) / Resolution.X;
                    ptX        = RoundUp(_PixelTemp);
                }
                else
                {
                    ptX = 0;
                }
            }
        }