1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2025-01-15 11:59:34 +00:00

Allows passing an empty file name to LoadImage to reset PictureBox canvas.

This commit is contained in:
FellippeHeitor 2018-06-11 20:13:10 -03:00
parent 1b05a1ef23
commit abb32988b1

View file

@ -4449,9 +4449,14 @@ SUB LoadImage (This AS __UI_ControlTYPE, File$)
This.HelperCanvas = IconPreview(File$) This.HelperCanvas = IconPreview(File$)
IF This.HelperCanvas >= -1 THEN ErrorMessage$ = "Unable to load file:" IF This.HelperCanvas >= -1 THEN ErrorMessage$ = "Unable to load file:"
END IF END IF
ELSE
IF File$ = "" THEN
'Passing an empty file name can be used to clean the canvas
This.HelperCanvas = _NEWIMAGE(This.Width, This.Height, 32)
ELSE ELSE
ErrorMessage$ = "Missing image file:" ErrorMessage$ = "Missing image file:"
END IF END IF
END IF
IF LEN(ErrorMessage$) THEN IF LEN(ErrorMessage$) THEN
IF NotFoundImage = 0 THEN NotFoundImage = __UI_LoadThemeImage("notfound.png") IF NotFoundImage = 0 THEN NotFoundImage = __UI_LoadThemeImage("notfound.png")