function on_paint(gr) {
/*/ note:
- aimp_bg_img : background image
- aimp_needle_img : needle image
- aimp_needle_img : cover image
/*/
. . .
var aimp = utils.CreateImage(aimp_bg_img.Width,aimp_bg_img.Height);
var gb = aimp.GetGraphics();
// paint background
gb.DrawImage(aimp_bg_img,0,0,aimp_bg_img.Width,aimp_bg_img.Height,0,0,aimp_bg_img.Width,aimp_bg_img.Height);
// paint needle adjusted by angle per db_RMS/peak levell
gb.DrawImage(aimp_needle_img,
0,0,aimp_needle_img.Width,aimp_needle_img.Height,
0,0,aimp_needle_img.Width,aimp_needle_img.Height/scaleHeight,
1,
dbToAngle(dB_RMS)
) ;
// paint cover
gb.DrawImage(aimp_bg_cover,0,0,aimp_bg_cover.Width,aimp_bg_cover.Height,0,0,aimp_bg_cover.Width,aimp_bg_cover.Height);
// garbage collection
aimp.ReleaseGraphics();
// draw image to the panel and LET the JSP3 scale image per panel dimension /width, height/
gr.DrawImage(aimp,0,0,ww/2,wh/2,0,0,aimp.Width,aimp.Height);
. . .
}