Wow TLM, this is great! Thanks for sharing. I have been looking for something like this for quite a while.
I have two questions for you (by the way, I'm really not familiar with ActiveX stuff):
1) What do the InkEd. and .1 parts mean in "InkEd.InkEdit.1"? What do the msinkaut. and .1 parts mean in "msinkaut.InkPicture.1"? How did you know to write them like that?
2) I've been exploring the different attributes following the MSDN link you provided. A whole new world to explore for me! Everything in my test script below works great on my tablet but I can't seem to be able to modify the color and the cursor (see the two highlighted lines.) Any idea what I'm doing wrong? The info for these is here:
http://msdn.microsoft.com/en-us/library/aa514608.aspx
http://msdn.microsoft.com/en-us/library/aa514610.aspx
Thanks again for sharing this, much appreciated.
Code: Select all
#SingleInstance, Force
SetBatchlines, -1
Gui, Add, Button, y5 gSetPen, Pen
Gui, Add, Button, y5 gSetSelect, Select
Gui, Add, Button, y5 gSetErase, Erase
Gui, Add, Button, y5 gSetThin, Thin
Gui, Add, Button, y5 gSetWide, Wide
Gui, Add, Button, y5 gSetOpaque, Opaque
Gui, Add, Button, y5 gSetTransparent, Transparent
Gui, Add, Button, y5 gPressure_On, Pressure On
Gui, Add, Button, y5 gPressure_Off, Pressure Off
Gui Add, ActiveX, xm w600 h100 vBox, msinkaut.InkPicture.1
;Box.AutoRedraw := true ;not necessary, but setting to false = ink disappears when gui is minimized
Box.DefaultDrawingAttributes.Width := 100
;;;;;;;;;;;;;;;;;;;;;;; THESE TWO LINES DON'T WORK
;Box.DefaultDrawingAttributes.Color := Color.Red
;Box.Cursor := System.Windows.Forms.Cursors.Cross
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Show, AutoSize
Return
SetPen:
Box.EditingMode := 0
Return
SetSelect:
Box.EditingMode := 2
Return
SetErase:
Box.EditingMode := 1
Return
SetThin:
Box.DefaultDrawingAttributes.Width := 100
Return
SetWide:
Box.DefaultDrawingAttributes.Width := 300
Return
SetOpaque:
Box.DefaultDrawingAttributes.Transparency := 0
Return
SetTransparent:
Box.DefaultDrawingAttributes.Transparency := 200
Return
Pressure_On:
Box.DefaultDrawingAttributes.IgnorePressure := false
Return
Pressure_Off:
Box.DefaultDrawingAttributes.IgnorePressure := true
Return
GuiClose:
ExitApp
F7::
Reload