Example #1
0
        public void Load_Image()
        {
            img = Bitmap.FromFile(m_strImagePath);

            string strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath.ini");

            if (LauncherForm.resolution_width < 1920 && LauncherForm.resolution_height < 1080)
            {
                strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_1600_1024.ini");
                if (LauncherForm.resolution_width < 1600 && LauncherForm.resolution_height < 1024)
                {
                    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_1280_768.ini");
                }
                else if (LauncherForm.resolution_width < 1280)
                {
                    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_LOW.ini");
                }
            }
            else if (LauncherForm.resolution_width > 1920)
            {
                strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_HIGH.ini");
            }

            IniParser parser = new IniParser(strINIPath);

            string sZoom     = parser.GetSetting("LOCATIONIMG", "ZOOM");
            double dZoomSale = 1.0;

            if (Int32.Parse(sZoom) > 0)
            {
                dZoomSale = 1 + (Int32.Parse(sZoom) * 0.1);
            }
            img = DeadlyImageCommon.resizeImage(img, dZoomSale);
        }
Example #2
0
        private void BtnZoomIn_Click(object sender, EventArgs e)
        {
            string strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath.ini");

            if (LauncherForm.resolution_width < 1920 && LauncherForm.resolution_height < 1080)
            {
                strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_1600_1024.ini");
                if (LauncherForm.resolution_width < 1600 && LauncherForm.resolution_height < 1024)
                {
                    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_1280_768.ini");
                }
                else if (LauncherForm.resolution_width < 1280)
                {
                    strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_LOW.ini");
                }
            }
            else if (LauncherForm.resolution_width > 1920)
            {
                strINIPath = String.Format("{0}\\{1}", Application.StartupPath, "ConfigPath_HIGH.ini");
            }

            IniParser parser = new IniParser(strINIPath);

            string sZoom = parser.GetSetting("LOCATIONIMG", "ZOOM");

            nZoom = Int32.Parse(sZoom);

            img   = Bitmap.FromFile(m_strImagePath);
            nZoom = nZoom + 100;
            if (img.Width + nZoom <= 1920 && img.Height + nZoom <= 1080)
            {
                double dZoomSale = 1.0;
                if (nZoom > 0)
                {
                    dZoomSale = 1 + (nZoom * 0.1);
                }
                img = DeadlyImageCommon.resizeImage(img, dZoomSale);

                parser.AddSetting("LOCATIONIMG", "ZOOM", nZoom.ToString());
                parser.SaveSettings();

                this.Invalidate();
                this.Update();
                this.Refresh();
            }
        }