protected override void OnSizeChanged(EventArgs e) { if (GlImage != null) { var dw = (Width - m_previousControlWidth) * Density; var dh = (Height - m_previousControlHeight) * Density; m_currentImageView.X -= dw / 2f; m_currentImageView.Width += dw; m_currentImageView.Y -= dh / 2f; m_currentImageView.Height += dh; } GlWindow.Begin(); GlWindow.ResizeWindow(Width, Height); Gl.MatrixMode(Gl.GL_PROJECTION); Gl.LoadIdentity(); Gl.Ortho2D(0, Width, Height, 0); GlWindow.End(); m_previousControlWidth = Width; m_previousControlHeight = Height; FixImageView(); base.OnSizeChanged(e); }
protected override void OnSizeChanged(EventArgs e) { if (m_imageBoxWindow == null) { return; } m_glWindow.Begin(); m_glWindow.ResizeWindow(Width, Height); Gl.MatrixMode(Gl.GL_PROJECTION); Gl.LoadIdentity(); Gl.Ortho2D(0, Width, Height, 0); m_glWindow.End(); base.OnSizeChanged(e); }