Ducks and some other birds stand on one leg, called unipedal resting, to help regulate and maintain body temperature. A bird on ice reduces the amount of unfeathered surface exposed to the elements by standing on one leg.
The evolutionary adaptation that helps minimize loss of warmth is called "rete mirabile." Birds' legs will come in contact with the cold surface, and the arteries that move warm blood into the legs come in contact with veins that, in turn, take colder blood to the bird's heart. By subtracting the amount of unfeathered surface that touches the cold ground, birds keep themselves warmer. The same concept applies when flamingos stand in water.
The leg may bend slightly in order to maintain balance. The base of the foot aligns with the center of gravity. Switching legs during unipedal resting helps prevent tissue damage from one foot touching the ground for too long, according to researchers at St. Joseph's University. Birds can regulate their body temperature through other methods. Turning away or toward the sun affects the bird's body temperature as well. Standing in water tends to cool down birds. Fluffing out feathers is also another method to increase insulation and warmth.