コード例 #1
0
        /// <summary>
        /// Sets the scale and creates a new floorplan in m_host, ending the DrawScale loop
        /// </summary>
        /// <param name="scaleLength">the length of the line drawn</param>
        private void SetScale(double scaleLength)
        {
            using (ScaleForm sf = new ScaleForm(scaleLength, scaleLength / m_scale, this))
            {
                sf.ShowDialog();                                                // Show the ScaleForm

                if (m_fpState == fpState.SETDEST)
                {
                    m_scale = sf.m_scale;                                                                        // When we return, get the scale from the form

                    m_host.CreateStatus(m_floorPlanImage, m_scale);                                              // Create a new floorplan

                    m_ratioX = (double)(m_host.Status.FloorPlan.getXTileNum()) / (double)(floorPlanPanel.Width); // figure out the ratio of the size of
                    m_ratioY = (double)m_host.Status.FloorPlan.getYTileNum() / (double)floorPlanPanel.Height;    // the floorplan to the panel
                }
            }

            DrawFloor();                                                        // Draw the floor
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: tkram01/see3po
        /// <summary>
        /// Sets the scale and creates a new floorplan in m_host, ending the DrawScale loop
        /// </summary>
        /// <param name="scaleLength">the length of the line drawn</param>
        private void SetScale(double scaleLength)
        {
            using (ScaleForm sf = new ScaleForm(scaleLength, scaleLength / m_scale, this))
            {
                sf.ShowDialog();                                                // Show the ScaleForm

                if (m_fpState == fpState.SETDEST)
                {
                    m_scale = sf.m_scale;                                           // When we return, get the scale from the form

                    m_host.CreateStatus(m_floorPlanImage, m_scale);              // Create a new floorplan

                    m_ratioX = (double)(m_host.Status.FloorPlan.getXTileNum()) / (double)(floorPlanPanel.Width); // figure out the ratio of the size of
                    m_ratioY = (double)m_host.Status.FloorPlan.getYTileNum() / (double)floorPlanPanel.Height; // the floorplan to the panel
                }

            }

            DrawFloor();                                                        // Draw the floor
        }