Help! Automation image painting in panel
-
const var instimg_pnl1 = Content.getComponent ("instimg_pnl1"); instimg_pnl1.loadImage("{PROJECT_FOLDER}instimg_pnl1.png", "instimg_pnl1"); instimg_pnl1.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.drawImage ("instimg_pnl1", a, 0, 0); }); const var instimg_pnl2 = Content.getComponent ("instimg_pnl2"); instimg_pnl2.loadImage("{PROJECT_FOLDER}instimg_pnl2.png", "instimg_pnl2"); instimg_pnl2.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.drawImage ("instimg_pnl2", a, 0, 0); }); const var instimg_pnl3 = Content.getComponent ("instimg_pnl3"); instimg_pnl3.loadImage("{PROJECT_FOLDER}instimg_pnl3.png", "instimg_pnl3"); instimg_pnl3.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.drawImage ("instimg_pnl3", a, 0, 0); }); const var instimg_pnl4 = Content.getComponent ("instimg_pnl4"); instimg_pnl4.loadImage("{PROJECT_FOLDER}instimg_pnl4.png", "instimg_pnl4"); instimg_pnl4.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.drawImage ("instimg_pnl4", a, 0, 0); }); const var instimg_pnl5 = Content.getComponent ("instimg_pnl5"); instimg_pnl5.loadImage("{PROJECT_FOLDER}instimg_pnl5.png", "instimg_pnl5"); instimg_pnl5.setPaintRoutine(function(g) { var a = this.getLocalBounds(0); g.drawImage ("instimg_pnl5", a, 0, 0); });i have writen code that paints image for each panel separately how do i write a loop that minimize the amount of code