Example #1
0
        public static void GetOperImgPosiAndSize(int i, out OperImgPosiSize sOperImgPosiSize)
        {
            string ScreenWidth  = SystemInformation.PrimaryMonitorSize.Width.ToString();
            string ScreenHeight = SystemInformation.PrimaryMonitorSize.Height.ToString();

            sOperImgPosiSize = new OperImgPosiSize();
            int currentNo = (i % 8);

            if (currentNo == 0)
            {
                sOperImgPosiSize.OperPosiLeft = 5;
                sOperImgPosiSize.OperPosiTop  = 118;
            }
            else if (currentNo == 1)
            {
                sOperImgPosiSize.OperPosiLeft = 5 + (float)(180 * 1366 / Convert.ToDouble(ScreenWidth));
                sOperImgPosiSize.OperPosiTop  = 118;
            }
            else if (currentNo == 2)
            {
                sOperImgPosiSize.OperPosiLeft = 5 + (float)(360 * 1366 / Convert.ToDouble(ScreenWidth));
                sOperImgPosiSize.OperPosiTop  = 118;
            }
            else if (currentNo == 3)
            {
                sOperImgPosiSize.OperPosiLeft = (float)(540 * 1366 / Convert.ToDouble(ScreenWidth));
                sOperImgPosiSize.OperPosiTop  = 118;
            }
            else if (currentNo == 4)
            {
                sOperImgPosiSize.OperPosiLeft = 5;
                sOperImgPosiSize.OperPosiTop  = 265;
            }
            else if (currentNo == 5)
            {
                sOperImgPosiSize.OperPosiLeft = 5 + (float)(180 * 1366 / Convert.ToDouble(ScreenWidth));
                sOperImgPosiSize.OperPosiTop  = 265;
            }
            else if (currentNo == 6)
            {
                sOperImgPosiSize.OperPosiLeft = 5 + (float)(360 * 1366 / Convert.ToDouble(ScreenWidth));
                sOperImgPosiSize.OperPosiTop  = 265;
            }
            else if (currentNo == 7)
            {
                sOperImgPosiSize.OperPosiLeft = (float)(540 * 1366 / Convert.ToDouble(ScreenWidth));
                sOperImgPosiSize.OperPosiTop  = 265;
            }
            sOperImgPosiSize.OperImgWidth  = 160;
            sOperImgPosiSize.OperImgHeight = 115;


            float width  = sOperImgPosiSize.OperImgWidth;
            float height = sOperImgPosiSize.OperImgHeight;

            Excel_CommonFun.GetScreenResolution(ref width, ref height);
            sOperImgPosiSize.OperImgWidth  = width;
            sOperImgPosiSize.OperImgHeight = height;
        }
Example #2
0
        public static void GetFixImgPosiAndSize(double left, double top, double width, double height, out FixImgPosiSize sFixImgPosiSize)
        {
            string ScreenWidth  = SystemInformation.PrimaryMonitorSize.Width.ToString();
            string ScreenHeight = SystemInformation.PrimaryMonitorSize.Height.ToString();

            sFixImgPosiSize = new FixImgPosiSize();
            //sFixImgPosiSize.FixPosiLeft = 485;
            sFixImgPosiSize.FixPosiLeft = (float)(left * 1366 / Convert.ToDouble(ScreenWidth));
            sFixImgPosiSize.FixPosiTop  = (float)top;
            //sFixImgPosiSize.FixPosiTop = (float)(423 * 768 / Convert.ToDouble(ScreenHeight));
            //sFixImgPosiSize.FixImgWidth = 225;
            //sFixImgPosiSize.FixImgHeight = 198;

            float widthfloat  = (float)width;
            float heightfloat = (float)height;

            Excel_CommonFun.GetScreenResolution(ref widthfloat, ref heightfloat);
            sFixImgPosiSize.FixImgWidth  = widthfloat;
            sFixImgPosiSize.FixImgHeight = heightfloat;
        }