Problem inserting image within MP

Hello, this is a probably basic question, but the following code doesn't compile: ---- \setupbackgrounds[page][background={Bkg}] \defineoverlay[Bkg][\useMPgraphic{Bkg}] \startuseMPgraphic{Bkg} externalfigure "hacker.png"; \stopuseMPgraphic \starttext Ahoj \stoptext ---- with: "
picture ! Isolated expression. <to be read again> ; <*> externalfigure "hacker.png"; ; I couldn't find an `=' or `:=' after the expression that is shown above this error message, so I guess I'll just ignore it and carry on. "
I just want to insert a picture from within MP code. What am I doing wrong? Best regards, Lukas

On 10 Oct 2019, at 13:23, context@vivaldi.net wrote:
Hello,
this is a probably basic question, but the following code doesn't compile:
---- \setupbackgrounds[page][background={Bkg}]
\defineoverlay[Bkg][\useMPgraphic{Bkg}]
\startuseMPgraphic{Bkg} externalfigure "hacker.png”;
Use draw externalfigure “hacker.png”; Best wishes, Taco

On Thu, 10 Oct 2019, context@vivaldi.net wrote:
Hello,
this is a probably basic question, but the following code doesn't compile:
---- \setupbackgrounds[page][background={Bkg}]
\defineoverlay[Bkg][\useMPgraphic{Bkg}]
\startuseMPgraphic{Bkg} externalfigure "hacker.png"; \stopuseMPgraphic
\starttext Ahoj \stoptext
Taco has already answered the question, but if you just want to insert the image as a background, there is no need to do so via MP. The following also works: \setupexternalfigures[location={local,global,default}] \setupbackgrounds[page][background={Bkg}] \defineoverlay[Bkg][{\externalfigure[hacker.png][width=\overlaywidth, height=\overlayheight]}] \starttext Ahoj \stoptext Aditya
participants (3)
-
Aditya Mahajan
-
context@vivaldi.net
-
Taco Hoekwater