コード例 #1
0
ファイル: Form1.cs プロジェクト: xvok16/TDCGExplorer
        private void AssignSliderProportion()
        {
            Figure fig;

            if (viewer.TryGetFigure(out fig))
            {
                foreach (TPOFile tpo in fig.TPOList.files)
                {
                    ProportionSlider slider = slidermap[tpo.Proportion];
                    slider.Tag   = tpo;
                    slider.Ratio = tpo.Ratio;
                }
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: xvok16/TDCGExplorer
        private void slider_ValueChanged(object sender, EventArgs e)
        {
            ProportionSlider slider = sender as ProportionSlider;

            {
                TPOFile tpo = slider.Tag as TPOFile;
                if (tpo != null)
                {
                    tpo.Ratio = slider.Ratio;
                }
            }

            Transform();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: xvok16/TDCGExplorer
        public Form1(TSOConfig tso_config, string[] args)
        {
            InitializeComponent();
            this.ClientSize = tso_config.ClientSize;
            viewer          = new Viewer();

            if (viewer.InitializeApplication(this))
            {
                viewer.FigureEvent += delegate(object sender, EventArgs e)
                {
                    Transform();
                };
                foreach (string arg in args)
                {
                    viewer.LoadAnyFile(arg, true);
                }
                if (viewer.FigureList.Count == 0)
                {
                    viewer.LoadAnyFile(Path.Combine(save_path, "system.tdcgsav.png"), true);
                }
                viewer.Camera.SetTranslation(0.0f, +10.0f, +44.0f);

                timer1.Enabled = true;
            }

            slidermap = new Dictionary <IProportion, ProportionSlider>();
            {
                int nproportion = 0;
                foreach (IProportion proportion in ProportionList.Instance.items)
                {
                    ProportionSlider slider = new ProportionSlider();
                    slider.ClassName = proportion.ToString();

                    slider.Location      = new System.Drawing.Point(0, nproportion * 64);
                    slider.ValueChanged += new System.EventHandler(this.slider_ValueChanged);
                    panel1.Controls.Add(slider);

                    slidermap[proportion] = slider;
                    nproportion++;
                }
            }

            AssignSliderProportion();
        }