How to draw a line in canvas screen space overlay

can someone help me out on this one…I am working on an application and i have to create lines so i used the method where i am instantiating an image using drag events and then increase its scale size as the mouse pointer drags but this technique fails when you change the screen resolution, So can anyone suggest how to overcome this problem. I also tried usign UI Line Renderer extention that works with screen space overlay but i am not able to successfully create a line inside the screen space using it.