Selection box - Borders scaling when selection box size grows

Using Unity 5.3.4

When drawing my selection box to the screen using :

GUI.DrawTexture(selectionRect, this.SelectionTexture);

The texture draws in the correct position, but the 1px border scales, which I don’t want it do to. No matter the size of the selection box, I would like the border to stay at 1px.

I have adjusted the texture in the sprite editor to be of type Sprite (2D and UI), to be Single and to have a border of L:1 B:1 R:1 T:1

I have seen a similar question asked here : 9-Sliced Legacy GUI - Questions & Answers - Unity Discussions but I’m unsure of the syntax that the accepted answer mentions.

Any clues what I might be doing wrong with GUI.DrawTexture() to draw my texture as a sliced texture ? Or whether I need to use another method, and what that syntax might be ?

While I don’t know the exact details of how frames get scaled in the unity editor UI: I CAN tell you that this procedural texture (discovered via trial and error) DOES keep the lines 1 pixel in size, regardless of how large I scale it. It’s basically 8x8 pixels, with a 1pix border of color(black here) on the edges:

 Texture2D FrameTex()
        {
            int dim = 8;
            Texture2D texture = new Texture2D(dim, dim, TextureFormat.ARGB32, false);
            texture.alphaIsTransparency = true;
            for (int i = 0; i < dim; i++)
                for (int j = 0; j < dim; j++)
                {
                    if (i == 0 || j == 0 || i == dim - 1 || j == dim - 1)
                        texture.SetPixel(i, j, new Color(0, 0, 0, 1));
                    else
                        texture.SetPixel(i, j, new Color(0, 0, 0, 0));
                }
            texture.Apply();
            return texture;
        }