After removing the hinges, remove the rust with a wire brush and clean out any dents using coarse-grain sandpaper works best. Take the frame back to the bare metal, then apply two coats of metal primer. Wait while it dries, and then apply two coats of paint.