Hi.,
Try like this.,
var Img_Url = $.sap.getModulePath("<Componentname>", "<image folder path>");
this.getView().byId("<id>").setIcon(Img_Url+"<Image name>");
sample code will be like this
var Img_Url = $.sap.getModulePath("Travel.Create", "/view/image/");
this.getView().byId("idIcon").setIcon(Img_Url+"Image.png");
-Mahi