Sounds like an injury to the gastocnemius part of the calf complex. This one crosses botht the knee and ankle. Thats why the pain is gone with a bent knee. Rising on tip toes doesn't stretch that to full length but dropping the heal or raising the foot with a straight knee does. I'd suggest seeing someone for some massage to the area and perhaps do some calf raises on a step to stretch it out through it's full length.