//TODO: Use onDraw instead of this... private void Form2_Resize(object sender, EventArgs e) { if (m_isLoading) { return; } int starttime = Environment.TickCount; try { this.Cursor = Cursors.WaitCursor; double scale = m_coordSys.CalculateScale(m_env, pictureBox1.Size); m_env = m_coordSys.AdjustBoundingBox(m_env, scale, pictureBox1.Size); LittleSharpRenderEngine.LittleSharpRenderEngine eng = new LittleSharpRenderEngine.LittleSharpRenderEngine(m_env, m_coordSys.CoordinateSystem, pictureBox1.Size, Color.White); for (int i = 0; i < m_layers.Count; i++) { if (LayerListBox.GetItemChecked(i)) { eng.RenderFeatures(m_coordSys.CoordinateSystem, m_layers[i].GetFeatures(m_env, null, DisableScalesButton.Checked ? double.NaN : scale)); } } pictureBox1.Image = eng.Bitmap; CurrentScale.Text = "1:" + scale.ToString("0.00"); } finally { this.Cursor = Cursors.Arrow; } int endtime = Environment.TickCount; SpeedMeasure.Text = Math.Round(1000.0 / (endtime - starttime), 1) + " fps"; }