LoadPicture redux: can't load image from handle
Issue #80
closed
I understand this should work, but it does not.
MyPic := LoadPicture(A_Desktop "\MyScreenClip.png")
MyGui := Gui()
MyScLabel := MyGui.Add("Text", "w300", "Get screenclip at 100, 100, 200, 200`nSave to Desktop as '\MyScreenClip.bmp")
MyLoadedPic := MyGui.Add("Picture", "y+10 w200 h 200", "HBITMAP*" MyPic["Handle"])
MyGui.Show("w350 h350")
Also tried with “HBITMAP:” instead of “HBITMAP*”, without success.
Comments (4)
-
repo owner -
reporter Tested this code, works great, thank you!
MyPic := LoadPicture(A_Desktop "\MyScreenClip.png") MyGui := Gui() MyScLabel := MyGui.Add("Text", "w300", "Get screenclip at 100, 100, 200, 200`nSave to Desktop as '\MyScreenClip.bmp") MyLoadedPic := MyGui.Add("Picture", "x10 y+10 w200 h200", "HBITMAP:" MyPic["Handle"]) MyGui.Show("w350 h350")
Also works with asterisk, proper syntax duly noted.
-
reporter - changed status to resolved
Resolved.
-
reporter - changed status to closed
closing. Very nice!
- Log in to comment
I’ve committed a fix, please test.
Note that the syntax is “HBITMAP:” OR “HBITMAP:*”