Use mouse draw line in the 2D,how to do?

Very Thank! OnMouseButtonUp,stop draw line,save Already draw line,how to do!