function OnStart() {
lay = app.CreateLayout("linear", "VCenter,FillXY");
lay.SetChildMargins(0, 0, 0, 32, "px");
app.AddImage(lay, "/Sys/Img/Hello.png", 0.2);
AddBlurImage(lay, "/Sys/Img/Hello.png", 0.2);
app.AddLayout(lay);
}
function AddBlurImage(lay, path, width) {
const src = app.CreateImage(path, width);
const w = src.GetAbsWidth(),
h = src.GetAbsHeight();
const val = 10;
const thumb = app.CreateImage(
null,
Math.round(w / val),
Math.round(h / val),
"px",
);
thumb.DrawImage(src, 0, 0, 1, 1);
const img = app.CreateImage(null, w, h, "px");
img.DrawImage(thumb, 0, 0, 1, 1);
lay.AddChild(img);
return img;
}