Draw text in OpenTK using QuickFont
<p>Please help me with this problem :(
This is what i'm trying to do:</p>

<p><a href="https://i.stack.imgur.com/2Ueb9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Ueb9.png" alt="enter image description here"></a></p>

<p>Because QuickFont use different coordinate system with my ortho so i have to calculate coordinate for my text and it's ok.</p>

<p>The problem is when i resized the form, the text's coordiantes become wrong.</p>

<p><a href="https://i.stack.imgur.com/mDz6f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mDz6f.png" alt="enter image description here"></a></p>

<p>Here is my code:</p>

<pre><code>public static void DrawOxy(float lO, float rO, float tO, float bO, int controlW, int controlH)
        {
            GL.Color3(Color.Blue);
            GL.Begin(BeginMode.Lines);
            GL.Vertex2(lO, 0);
            GL.Vertex2(rO, 0);
            GL.Vertex2(0, tO);
            GL.Vertex2(0, bO);
            for (float i = lO; i &lt; rO; i+=2)
            {
                GL.Vertex2(i, 0.5);
                GL.Vertex2(i, -0.5);
            }
            for (float j = bO; j &lt; tO; j+=2)
            {
                GL.Vertex2(0.2, j);
                GL.Vertex2(-0.2, j);
            }
            GL.End();
            QFont font = new QFont(new Font(FontFamily.GenericSansSerif, 15));
            GL.PushAttrib(AttribMask.ColorBufferBit);
            font.Options.Colour = Color.Red;
            QFont.Begin();
            float horStep = ((float)controlW / rO);
            font.Print(horStep.ToString(), new Vector2(0, 0));
            float beginX = 0;
            for (float i = lO; i &lt; rO; i += 2)
            {
                font.Print(i.ToString(), new Vector2(beginX, (((float)controlH / 2))));
                beginX += horStep;
            }
            QFont.End();
            GL.PopAttrib();
        }


private void SetupViewport()
        {
            int w = glControl1.Width;
            int h = glControl1.Height;
            int left = -(w / 2);
            int right = w / 2;
            int top = h / 2;
            int bottom = -(h / 2);
            GL.MatrixMode(MatrixMode.Projection);
            GL.LoadIdentity();
            GL.Ortho(leftOr, rightOr, bottomOr, topOr, -1, 1); // Bottom-left corner pixel has coordinate (0, 0)
            GL.Viewport(0, 0, w, h); // Use all of the glControl painting area
        }

        private void glControl1_Load(object sender, EventArgs e)
        {
            loaded = true;
            GL.ClearColor(Color.White);
            SetupViewport();
        }


        private void glControl1_Paint(object sender, PaintEventArgs e)
        {
            if (!loaded) // Play nice
                return;

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            GL.LineWidth(2);
            DrawingObjects.DrawOxy(leftOr, rightOr, topOr, bottomOr, glControl1.Width, glControl1.Height);


            glControl1.SwapBuffers();
        }

        private void glControl1_Resize(object sender, EventArgs e)
        {
            if (!loaded)
            {
                return;
            }

            SetupViewport();
        }
</code></pre>

<p>Sorry about my english :)</p>