Signature app (retrieving image from activex)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
labrint
Posts: 379
Joined: 14 Jun 2017, 05:06
Location: Malta

Signature app (retrieving image from activex)

Post by labrint » 28 Jan 2022, 09:28

Hi,

Does anyone know how to capture the drawn image from this code:

Code: Select all

Gui Add, Text,, Draw in the picture box below
Gui Add, ActiveX, xm w600 h300 vss, msinkaut.InkPicture.1
Gui, Show, AutoSize
Return

GuiClose:
ExitApp
Return
I would like the user to be able to insert a signature, which will be converted to an image which is then uploaded to a database to mark a delivery as done.

References @TLM old forum post https://www.autohotkey.com/boards/viewtopic.php?f=6&t=221

User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: Signature app (retrieving image from activex)

Post by boiler » 28 Jan 2022, 10:58

Code: Select all

#Include <Gdip_All> ; https://www.autohotkey.com/boards/viewtopic.php?t=6517

Gui Add, Text,, Draw in the picture box below.  Press F1 to save.
Gui Add, ActiveX, xm w600 h300 vss hwndImageID, msinkaut.InkPicture.1
Gui, Show, AutoSize
Return

F1::
	pToken := Gdip_Startup()
	pBitmap := Gdip_BitmapFromHWND(ImageID)
	Gdip_SaveBitmapToFile(pBitmap, "image.png")
	Gdip_DisposeImage(pBitmap)
	Gdip_Shutdown(pToken)
Return

GuiClose:
ExitApp
Return

Post Reply

Return to “Ask for Help (v1)”