Displaying image gotten via winhttp com object

Get help with using AutoHotkey and its commands and hotkeys
Posts: 7
Joined: 06 Oct 2017, 16:00

Displaying image gotten via winhttp com object

25 Dec 2017, 08:56

Hi there,

so fore i'm using the following code to retrieve a jpeg from an online site (after authentication).

resultPicture := MyWebRequest.ResponseBody
ResultPictureSize := resultPicture._MaxIndex()
fh := FileOpen(destinationFile, "w")
for DataByte in ResultPicture
Gui, Add, Picture,w300 h300, %destinationFile%
Gui, Show

All works fine, however... can this code be shortened? If so, maybe one other problem can simultaneously be solved... not storing the file on the filesystem....
Any idea's?
User avatar
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Displaying image gotten via winhttp com object

25 Dec 2017, 09:12

- I have an example here to download an image/icon to a variable, and display it using SplashImage.
download urls to vars, partially/fully, via WinHttpRequest - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 09#p168409

- You can use an hBitmap with AHK GUIs:
GUI Control Types
https://autohotkey.com/docs/commands/Gu ... tm#Picture
[v1.1.23+]: A bitmap or icon handle can be used instead of a filename. For example, HBITMAP:%handle%.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Bing [Bot], Chunjee, ConTrast77, dobbelina, downstairs, Google [Bot], WatsonEnterprises, WuffTheCoder, Xtra and 65 guests