Page 1 of 2

IA

PostPosted: Mon Apr 04, 2022 5:55 pm
by elvira

Re: IA

PostPosted: Mon Apr 04, 2022 8:12 pm
by Jimmy
hi,

not sure to which Thread it belong.
as it talk about "Handwritten" recognition you can use Microsoft INK for it

have a look in HMG Forum
http://www.hmgforum.com/viewtopic.php?f=5&t=7206

you will find Source for this
Image

Re: IA

PostPosted: Mon Apr 04, 2022 9:04 pm
by Antonio Linares
Dear Jimmy,

A quick test with FWH. Many thanks! :-)
Code: Select all  Expand view
#include "FiveWin.ch"

STATIC myRecognizers
STATIC myInkCollector
static oWnd

PROCEDURE MAIN

   DEFINE WINDOW oWnd MENU BuildMenu()

   myRecognizers := CreateObject( "msinkaut.InkRecognizers" )

   myInkCollector := CreateObject( "msinkaut.InkCollector" )
   myInkCollector:hWnd := oWnd:hWnd
   myInkCollector:Enabled = .T.

   ACTIVATE WINDOW oWnd

RETURN

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "Text" ACTION MsgInfo( myInkCollector:Ink:Strokes:ToString() )
      MENUITEM "Clean" ACTION ( myInkCollector:Ink:DeleteStrokes( myInkCollector:Ink:Strokes ), oWnd:Refresh() )
   ENDMENU
   
return oMenu  

Re: IA

PostPosted: Mon Apr 04, 2022 9:20 pm
by Jimmy
glad that i can help.

Re: IA

PostPosted: Mon Apr 04, 2022 9:27 pm
by Antonio Linares
Dear Jimmy,

Do you know if there is a similar API to talk to Cortana ?

many thanks

Re: IA

PostPosted: Tue Apr 05, 2022 8:48 pm
by Jimmy
hi Antonio,

i do not use Cortana ... i have de-install it :wink:

Poweshell with Administrator Rights
Code: Select all  Expand view
 „Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage“ 

---

as i know "Dictate"
https://techcrunch.com/2017/06/20/microsofts-dictate-uses-cortanas-speech-recognition-to-enable-dictation-in-office/

have been integrate in Office 365 and Windows 10
https://www.microsoft.com/en-us/garage/profiles/dictate/

as i can say you need to learn "Windows Speech Recognition commands"
https://support.microsoft.com/en-us/windows/windows-speech-recognition-commands-9d25ef36-994d-f367-a81a-a326160128c7

p.s. as i know Cortana work only when Online

Re: IA

PostPosted: Wed Apr 06, 2022 6:42 am
by MarcoBoschi
Is it possible to load from an image file a written text?

bye to all

marco

Re: IA

PostPosted: Wed Apr 06, 2022 6:24 pm
by Horizon
MarcoBoschi wrote:Is it possible to load from an image file a written text?

bye to all

marco


Plus

Can this image be car plate?

Re: IA

PostPosted: Wed Apr 06, 2022 10:38 pm
by Jimmy
hi,

Microsoft INK is made for Handwriting and Gesture and not work like OCR Apps

have a look at this Article
https://www.codemag.com/article/0512042

Re: IA

PostPosted: Wed Apr 06, 2022 11:28 pm
by Antonio Linares
In this document it seems as they are able to use an image:

https://silo.tips/download/erstellen-von-tablet-pc-anwendungen-mit-visual

PROCEDURE cmdLoad.Click
lsInk = CREATEBINARY(FILETOSTR(GETFILE("isf")))
thisform.inkoverlay.Enabled = 0
thisform.inkoverlay.ink.Load(lsInk)
thisform.inkoverlay.Enabled = 1
*--Tell control to redraw, or changes will not be made visible.
*-- Use the InkRectangle object we
*-- created during form Init.
ThisForm.inkoverlay.Draw(ThisForm.InkRectangle)
ENDPROC

Re: IA

PostPosted: Wed Apr 06, 2022 11:40 pm
by Antonio Linares
Here is the document translated into english for better understanding and reading:

https://github.com/FiveTechSoft/screenshots/blob/master/Building%20Tablet%20PC%20Applications%20with%20Visual%20FoxPro.pdf

Re: IA

PostPosted: Thu Apr 07, 2022 12:45 am
by cmsoft
Antonio:
Hay equivalente en Fivewin a CREATEBINARY y FILETOSTR, tenemos algo asi?
FILETOSTR imagino que podría ser MemoRead()

Intente de algunas formas pero no tengo ningun resultado.
Esto funciona bien:
Code: Select all  Expand view
MENUITEM "Copy" ACTION myInkCollector:Ink:ClipBoardCopy()

Copia al portapapeles de manera correcta
Code: Select all  Expand view
MENUITEM "Paste" ACTION (myInkCollector:Enabled := .f.,myInkCollector:Ink:ClipBoardPaste(),myInkCollector:Enabled := .T.)

No da error pero no muestra nada

Re: IA

PostPosted: Thu Apr 07, 2022 11:55 am
by Antonio Linares
César,

Me parece que ese método lo que hace es salvar lo escrito y luego recargarlo

Hay mucha documentación al respecto que hay que revisar:
https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/ms583746(v=vs.85)

Re: IA

PostPosted: Thu Apr 07, 2022 12:01 pm
by Antonio Linares

Re: IA

PostPosted: Thu Apr 07, 2022 10:50 pm
by Jimmy
hi Antonio,

thx for the link.

i have read Germen VFP-PDF which work with ActiveX
Code: Select all  Expand view
Microsoft InkEdit Control
{E5CA59F5-57C4-4DD8-9BD6-1DEEEDD27AF4}
ProgID "InkEd.InkEdit.1"


you also point me to other ActiveX
Code: Select all  Expand view
Microsoft InkPicture Control
{04a1e553-fe36-4fde-865e-344194e69424}
ProgID "msinkaut.InkPicture.1"


---

C:\Program Files\Common Files\Microsoft Shared\Ink\
InkObj.dll seem me to be the ActiveX and have these Interface
Code: Select all  Expand view
InkDisp
InkOverlay
InkPicture
InkCollector
InkDrawingAttributes
InkRectangle
InkRenderer
InkTransform
InkRecognizers
InkRecognizerContext
InkRecognizerGuide
InkTablets
InkWordList
InkStrokes
Ink
SketchInk


my Sample work with InkCollector and InkRecognizers only

Load/Save are Method from InkDisp / InkOverlay so i need to learn more
https://docs.microsoft.com/en-us/windows/win32/tablet/inkdisp-class

about Save
https://docs.microsoft.com/en-us/windows/win32/api/msinkaut/nf-msinkaut-iinkdisp-save
default it use "InkSerializedFormat" to create ISF (ink serialized format) File.
when use GIF
Ink is persisted by using a Graphics Interchange Format (GIF) file that contains ISF as metadata that is embedded within the file.

Specification about ISF
https://download.microsoft.com/download/0/B/E/0BE8BDD7-E5E8-422A-ABFD-4342ED7AD886/InkSerializedFormat(ISF)Specification.pdf

about Load
https://docs.microsoft.com/en-us/windows/win32/api/msinkaut/nf-msinkaut-iinkdisp-load
The Save method allows you to persist the ink in an InkDisp object in Graphics Interchange Format (GIF) format, which consists of an array of byte data (the tla_gif persistence format is specified in the InkPersistenceFormat enumeration type). After you have the array of byte data, you can load the array of byte data into another InkDisp object. This means that you can load GIF-compatible byte array data into another InkDisp object in the same way as if you had called the Save method and received a byte array that was not in GIF format.


so how to create Byte Array
what can i use for CREATEBINARY() :?: