Hi, thanks for the reply. I don't know if i'm correct but i think that the actual OCR part happens here:
Code: Select all
BitmapFrameWithSoftwareBitmap := ComObjQuery(BitmapDecoder, IBitmapFrameWithSoftwareBitmap := "{FE287C9A-420C-4963-87AD-691436E08383}")
DllCall(NumGet(NumGet(BitmapFrameWithSoftwareBitmap+0)+6*A_PtrSize), "ptr", BitmapFrameWithSoftwareBitmap, "ptr*", SoftwareBitmap) ; GetSoftwareBitmapAsync
WaitForAsync(SoftwareBitmap)
DllCall(NumGet(NumGet(OcrEngine+0)+6*A_PtrSize), "ptr", OcrEngine, ptr, SoftwareBitmap, "ptr*", OcrResult) ; RecognizeAsync
WaitForAsync(OcrResult)
DllCall(NumGet(NumGet(LinesList+0)+6*A_PtrSize), "ptr", LinesList, "int", A_Index-1, "ptr*", OcrLine)
On the UWP API website it's written that "to use the OCR capabilities of the OcrEngine class in your app, call the RecognizeAsync method. When you call the RecognizeAsync method of the OcrEngine class, the method returns an OcrResult object, which contains the recognized text and its size and position. The result is split into lines, and the lines are split into words. Each OcrLine object contains a collection of OcrWord objects, accessible via Words property of each OcrLine, and each OcrWord object specifies the text, size, and position information of the word in the image"
So i know the information i seek is in there, is one of the proprieties of the first OcrWord object inside each lines. The website call this property "BoundingRect" and inside is the position and size in pixels of the recognized word from the top left corner of image when the value of TextAngle property is 0 (zero). But how can i access this information for each line? This is how far i can go, so thanks in advance for any information or suggestion.