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:
parent
1b05a1ef23
commit
abb32988b1
1 changed files with 6 additions and 1 deletions
|
@ -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")
|
||||||
|
|
Loading…
Reference in a new issue