LoadPicture redux: can't load image from handle

Issue #80 closed
Winter Laite created an issue

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)

  1. Matt Feemster repo owner

    I’ve committed a fix, please test.

    Note that the syntax is “HBITMAP:” OR “HBITMAP:*”

  2. Winter Laite 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.

  3. Log in to comment