public void DrawFrame(RectangleF rect, float borderWidth, Color color)
        {
            float half = borderWidth / 2f;

            // Outer rectangle
            var p1 = new ColoredVertex(rect.Left - half, rect.Top - half, color);
            var p2 = new ColoredVertex(rect.Right + half, rect.Top - half, color);
            var p3 = new ColoredVertex(rect.Right + half, rect.Bottom + half, color);
            var p4 = new ColoredVertex(rect.Left - half, rect.Bottom + half, color);

            // Inner rectangle
            var p5 = new ColoredVertex(rect.Left + half, rect.Top + half, color);
            var p6 = new ColoredVertex(rect.Right - half, rect.Top + half, color);
            var p7 = new ColoredVertex(rect.Right - half, rect.Bottom - half, color);
            var p8 = new ColoredVertex(rect.Left + half, rect.Bottom - half, color);

            ColoredVertex[] data = { p1, p5, p2, p6, p3, p7, p4, p8, p1, p5 };
            device.SetTexture(0, null);
            DrawColoredVertices(PrimitiveType.TriangleStrip, 8, data);
        }
 private void DrawColoredVertices(PrimitiveType type, int count, ColoredVertex[] data)
 {
     using (var declaration = new VertexDeclaration(device, ColoredVertex.VertexElements))
     {
         device.VertexDeclaration = declaration;
         device.DrawUserPrimitives(type, count, data);
     }
 }