'No need for BeginDraw DrawScr
'No need for _SOURCE Control(DrawScr).HelperCanvas
exportimage1$ = "testimage.png"
Result
= SaveImage
(exportimage1$
, Control
(DrawScr
).HelperCanvas
, 0, 0, _WIDTH(Control
(DrawScr
).HelperCanvas
), _HEIGHT(Control
(DrawScr
).HelperCanvas
)) '<-- this is the important change IF Result
= 1 THEN 'file already found on drive KILL exportimage1$
'delete the old file Result
= SaveImage
(exportimage1$
, Control
(DrawScr
).HelperCanvas
, 0, 0, _WIDTH(Control
(DrawScr
).HelperCanvas
), _HEIGHT(Control
(DrawScr
).HelperCanvas
)) '<-- same here
'Again, no need for EndDraw DrawScr