Help me I'm blind.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

26 Dec 2019, 12:33

When executing the code did not present error, only the one that I mentioned above.

So if you have a solution to this error, the rest may work correctly.
I just used the code that is for NVDa. For we all who use audio programs use the nvda screen reader.
ahk7
Posts: 577
Joined: 06 Nov 2013, 16:35

Re: Help me I'm blind.

26 Dec 2019, 13:02

Edit:
for those looking for working code have a look at the "NVDA and AutoHotkey" post on the forum here https://www.autohotkey.com/boards/viewtopic.php?f=6&t=71172 and on GitHub here https://github.com/hi5/nvda-autohotkey

Perhaps if we simply try with the full path to the nvdaControllerClient32.dll it works. I modified the functions a bit in the script below and you should now change nvdapath to the full path to the DLL file. Fingers crossed it works

Code: Select all

/*

nvda functions by DojoMike from example_autohotkey.ahk
found at https://github.com/DojoMike/nvda/blob/d32552beffcb61e20bdccc6c730c14ddd87baa6d/extras/controllerClient/x86/example_autohotkey.ahk

nvdapath sets a variable we use in the functions at the end of the file,
apparently we need to have the full path to the DLL.
*/
 
; change nvdapath variable below to the path to nvdaControllerClient32.dll
Global nvdapath:="C:\program files\NVDA\nvdaControllerClient32.dll" 

test1:=nvdaController_testIfRunning()
if !test1
{
	; NVDA is not running, so provide some basic debug info.
	message := "NVDA is not running.  "
	if (Errorlevel)
	{
		message .= "The DLL call returned """ . test1 . """ and ErrorLevel was set to """ . ErrorLevel . """."
		message .= "Please refer to www.autohotkey.com for more information."
	}
	MsgBox % message
}
else
{
	; NVDA is running, so spreak and braille this information so the user knows.
	nvdaController_speakText("NVDA is running and script has started.")
	nvdaController_brailleMessage("NVDA is running and script has started.")
}

; This hotkey basically makes the S key work like Control (it makes NVDA stop talking)
Alt & s::nvdaController_cancelSpeech()

Alt & k::
MouseClick left, 250, 250
nvdaController_speakText("You pressed Alt & K")
Return

Alt & j::
MouseClick left, 200, 250
nvdaController_speakText("You pressed Alt & J")
Return


/*
 A part of NonVisual Desktop Access (NVDA)
 Copyright (C) 2007-2017 NV Access Limited, DojoMike
 This file is covered by the GNU Lesser General Public License, version 2.1.
 See the file license.txt for more details.

 DojoMike: Because AutoHotkey's DllCall function can be a bit tricky for newcomers, I've taken the liberty of creating the following wrapper functions.
 But of course, you could just as easily call the DLL directly, as I have done inside the functions.  But it might be easier to save the wrapper
 functions to a separate file and then including them (AutoHotkey has a #include directive similar to C++).
*/

nvdaController_testIfRunning()
{
	return DllCall(nvdapath . "\nvdaController_testIfRunning")
}

nvdaController_speakText(text)
{
	return DllCall(nvdapath . "\nvdaController_speakText", Str, text)
}

nvdaController_brailleMessage(text)
{
	return DllCall(nvdapath . "\nvdaController_brailleMessage", Str, text)
}

nvdaController_cancelSpeech()
{
	return DllCall(nvdapath . "\nvdaController_cancelSpeech")
}
Last edited by ahk7 on 01 Jan 2020, 04:40, edited 1 time in total.
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

26 Dec 2019, 14:00

Hi my noble friend.

I tried to copy the "nvdaControllerClient32.dll" dll to the folder path on my computer:

C: \ Program Files (x86) \ NVDA

but continues with the same message only from Msgbox command warning that "NVDA is not running. The DLL call returned" "and ErrorLevel was set to" -3 ". Please refer to www.autohotkey.com for more information."

I sincerely hope you don't get mad at me with so many questions and solution requests, my friend.

hugs.
ahk7
Posts: 577
Joined: 06 Nov 2013, 16:35

Re: Help me I'm blind.

26 Dec 2019, 14:07

Edit:
for those looking for working code have a look at the "NVDA and AutoHotkey" post on the forum here https://www.autohotkey.com/boards/viewtopic.php?f=6&t=71172 and on GitHub here https://github.com/hi5/nvda-autohotkey

So just to be sure I understand correctly. This test script works?

Code: Select all

nvdaIsRunning:=
DllCall("nvdaControllerClient32\nvdaController_testIfRunning", "int")
if(nvdaIsRunning = 0)
{
	result := DllCall("nvdaControllerClient32\nvdaController_speakText", "str", "NVDA Script is Working from AutoHotkey")
	if(errorLevel)
	{
		MsgBox, An error occured speaking through NVDA.
	}
ExitApp
Last edited by ahk7 on 01 Jan 2020, 04:40, edited 1 time in total.
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

26 Dec 2019, 15:06

Hello Friend

This is your last script test:

nvdaIsRunning: =
DllCall ("nvdaControllerClient32 \ nvdaController_testIfRunning", "int")
if (nvdaIsRunning = 0)
{
result: = DllCall ("nvdaControllerClient32 \ nvdaController_speakText", "str", "NVDA Script is Working from AutoHotkey")
if (errorLevel)
{
MsgBox, An error occured speaking through NVDA.
}
ExitApp

returned the following error:
ahk7
Posts: 577
Joined: 06 Nov 2013, 16:35

Re: Help me I'm blind.

26 Dec 2019, 16:22

I should have looked at it earlier but I thought NVDA was a paid program but it is free and I could install it in a portable manner so I did that. I managed to find the nvdaControllerClient DLLs both 32 and 64 bit versions and the script below works for me when using AutoHotkey 32 bit and AutoHotkey 64 bit so it shouldn't matter which version you are using.
I haven't installed any NVDA addons or extras so just the default voice and settings.
I hope it works on your computer as well.

Code: Select all

#NoEnv
#SingleInstance, force
SetBatchLines, -1

Alt & s::nvdaCancel()

Alt & k::
MouseClick left, 250, 250
nvdaSpeak("You pressed Alt & K")
Return

Alt & j::
MouseClick left, 200, 250
nvdaSpeak("You pressed Alt & J")
Return

nvdaSpeak(text)
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_speakText", "wstr", text)
	}

nvdaCancel()
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_cancelSpeech")
	}

nvdaBrailleMessage(text)
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_brailleMessage", "wstr", text)
	}

nvdaRunning() ; returns 0 if running
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_testIfRunning")
	}
For others:
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

26 Dec 2019, 17:06

Wonderful!!!

Now it worked!

You are awesome!

Now where will we put that message: "your script has been started". Is it similar to the script with microsft sap?

ISpVoice.Speak ("Your accessibility script has been started.")


I am very happy friend! Very happy indeed and you have no idea and can not imagine how great your gesture is!

If you allow me, I would like to be your friend of whatsapp, facebook or email.
ahk7
Posts: 577
Joined: 06 Nov 2013, 16:35

Re: Help me I'm blind.

26 Dec 2019, 17:23

Glad to hear it works - Indeed very similar to the Microsoft Voice, just add this line directly beneath the SetBatchlines, -1 line and it should speak the text when you start the script.

Code: Select all

nvdaSpeak("Your accessibility script has been started.")
Merry Christmas and Happy DJ-ing!
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

26 Dec 2019, 17:41

Perfect! It worked too!

Now I can put the other command lines above this line right ??

nvdaSpeak (text)
{
return DllCall ("nvdaControllerClient" A_PtrSize * 8 ".dll \ nvdaController_speakText", "wstr", text)
}

nvdaCancel ()
{
return DllCall ("nvdaControllerClient" A_PtrSize * 8 ".dll \ nvdaController_cancelSpeech")
}

nvdaBrailleMessage (text)
{
return DllCall ("nvdaControllerClient" A_PtrSize * 8 ".dll \ nvdaController_brailleMessage", "wstr", text)
}

nvdaRunning (); returns 0 if running
{
return DllCall ("nvdaControllerClient" A_PtrSize * 8 ".dll \ nvdaController_testIfRunning")
}


this part of the code will always be at the end right?
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

26 Dec 2019, 20:16

Hello Friend. I managed to enter the other commands and everything is working very well.
You did a great job.

I want to ask you now a question as to whether it is possible:

when doing the line "MouseClick right, 350, 350

; moves the mouse to the 350, 350 coordinate and opens a context menu.

  with 16 options. channel 1 through 16

Is there a possibility to make this context menu appear for my screen reader, and with the arrow keys scroll through the options and select any of them by pressing enter ???

like this:

alt control & shift c ::
MouseClick right, 350, 350
nvdaSpeak ("choose channel")

; by clicking on this option I would like to open a text menu and with the right arrow I will open another menu with options in the list from 1 to 16 and by clicking enter mark the channel
Return

thanks for listening.
hugs
ahk7
Posts: 577
Joined: 06 Nov 2013, 16:35

Re: Help me I'm blind.

27 Dec 2019, 12:54

You can add more hotkeys to the script, it doesn't matter that much where as long as it below the "Your accessibility script has been started." line.

I'm assuming that :

1. nvda doesn't see the context menu in your music program and therefore can't see the select channel menu

2. sending the appskey will show the context menu - if it doesn't you can try to replace {appskey} in the script below with {Rbutton}

I added two hotkeys in the script below:

1. alt ctrl shift c, this shows a menu with 16 channels which nvda can read. I added the & to each menu channel name so you can just press 5 to jump between channel 5 and 15, if you don't like that simply remove the & characters from each Menu line.

2. alt ctrl shift d, this shows an input box so you can enter a number. This is just to illustrate an alternative method or perhaps something you can use later.

There are more elegant or efficient ways to build a menu in AutoHotkey but this is very simple. So you can easily to build more menus if you need them.
Just make sure you give each menu a name - here it is MyChannelMenu - and a menu handler label - here it is MyChannelMenuHandler.

More information about Menus in AutoHotkey here https://www.autohotkey.com/docs/commands/Menu.htm

I hope it works.

Code: Select all

#NoEnv
#SingleInstance, force
SetBatchLines, -1

nvdaSpeak("Your accessibility script has been started.")

!^+c:: ; alt-control-shift-c
MouseClick right, 350, 350
nvdaSpeak ("choose channel")
Gosub, ChannelMenu
Return

!^+d:: ; alt-control-shift-d
MouseClick right, 350, 350
InputBox, Channel, Choose channel, Choose channel (enter number)
If ErrorLevel
	{
	 nvdaSpeak("You canceled")	
	 Return
	}
If Channel is not number
	{
	 nvdaSpeak("Incorrect number")	
	 Return
	}	
Send {Appskey}
Sleep 100 ; give the context menu some time to appear
Send {down %Channel%}	
Return


Alt & s::nvdaCancel()

Alt & k::
MouseClick left, 250, 250
nvdaSpeak("You pressed Alt & K")
Return

Alt & j::
MouseClick left, 200, 250
nvdaSpeak("You pressed Alt & J")
Return

nvdaSpeak(text)
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_speakText", "wstr", text)
	}

nvdaCancel()
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_cancelSpeech")
	}

nvdaBrailleMessage(text)
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_brailleMessage", "wstr", text)
	}

nvdaRunning() ; returns 0 if running
	{
	 return DllCall("nvdaControllerClient" A_PtrSize*8 ".dll\nvdaController_testIfRunning")
	}

; the & characters below make that number a shortcut, so you can type 5 and jump between channel 5 and 15
; if you don't like that remove the & characters
ChannelMenu:
Menu, MyChannelMenu, Add
Menu, MyChannelMenu, DeleteAll
Menu, MyChannelMenu, Add, Channel &1,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &2,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &3,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &4,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &5,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &6,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &7,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &8,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel &9,  MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&0, MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&1, MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&2, MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&3, MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&4, MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&5, MyChannelMenuHandler
Menu, MyChannelMenu, Add, Channel 1&6, MyChannelMenuHandler
Menu, MyChannelMenu, Show	
Return
	
MyChannelMenuHandler:
Send {Appskey}
Sleep 100 ; give the context menu some time to appear
Send {down %A_ThisMenuItemPos%}	
Return
thomasmessi
Posts: 51
Joined: 22 Dec 2019, 17:33

Re: Help me I'm blind.

27 Dec 2019, 17:29

Wow, awesome!

Now I need to link, when choosing channel 3 for example going down with the arrow keys, hit enter and confirm channel 3.

But excellent this form of menu when making the command and appearing the options.

In this case the task is more complicated because with this script we are recreating the interface with the script is not it?

I wanted to show you how it is getting through a video. I would record my screen with obs studio and you would see how it works and could give other ideas.

And my blind friends found the breakthroughs super amazing and I quoted you for the gigantic help. Although I don't know your name.
Janusz
Posts: 89
Joined: 18 Dec 2020, 17:47

Re: Help me I'm blind.

19 Dec 2020, 08:12

Dear specialists,
I would like to kindly ask you for other help. I Am also visually impaired with no sight at all. Does somebody of us know, if would be possible to make A little change inside AutoGUI-2.6.2 source code? This editor and its incorporated GUI creator is wonderful. But to be usable for A visually impaired developers, tzhere would had to be hod key, which automatically changes focus between new GUI window and between main application window. When I want to add A new control I have focus inside New GUi window. Then I must press a special NVDA screen reader short cut keys to activate right mouse click inside this window. Special context menu appear and I can add A new control. Such as Button. But I Am having issue. I can not correctly place focus to The main app window of The program.

So I can not add more than on GUI element when I Am using GUI window. I can only add one GUi element at A time. The question is, if is it technically possible to add hod keys, which will allow Me to change focus between main app window and between new GUi window. App do not allow to create more thanone New GUi application window.

In fact, autogui have The most accessible GUI creation tool. But there is still some problem.
Sure. I can also use special NVDA screen reader feature, which allow Me to use object navigation. So I can for exaple Choose The control and it is possible to add text. But it is not comfortable. Would somebody of us have A little time to make New GUi window more accessible?

Moderator : as @Alguimist is the (main/only/head-?) developer of AutoGui, this statement has been added to attract his attention. HTH
Last edited by BoBo on 19 Dec 2020, 08:54, edited 1 time in total.
ahk7
Posts: 577
Joined: 06 Nov 2013, 16:35

Re: Help me I'm blind.

19 Dec 2020, 11:19

I don't use AutoGui myself but I just installed it to try it out.

If understand your question correctly you want to be able to switch focus from the Window where you design the Gui back to the editor where the code is, is that correct?

If so, there is a menu option to "Show/Hide Preview Window" to show and hide this Gui you are making.

You can find it the Window menu - if you press the F11 key it will work too.

If you show this Gui it will be active so NVDA will say this as well, once hidden again it will speak the AutoGUI window title and code you are working on in your editor.
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: Help me I'm blind.

19 Dec 2020, 12:05

Moderator : as lexikos s the (main/only/head-?) developer of AutoHotkey, this statement has been added to attract his attention. HTH
I don't think that lexikos has anything to do with AutoGui specifically. You may want to address Alguimist instead, AutoGui's creator and maintainer, in AutoGui's main topic: https://www.autohotkey.com/boards/viewtopic.php?f=64&t=10157 or post in the AutoGui subforum: https://www.autohotkey.com/boards/viewforum.php?f=64
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Help me I'm blind.

19 Dec 2020, 12:37

@gregster Thx for pointing this out. Corrected the above statement accordingly. :)
gregster
Posts: 9111
Joined: 30 Sep 2013, 06:48

Re: Help me I'm blind.

19 Dec 2020, 13:07

BoBo wrote:
19 Dec 2020, 12:37
@gregster Thx for pointing this out. Corrected the above statement accordingly. :)
Ah, I see, that was a moderator's edit, not by the user. I mistook that (I actually thought the moderator was addressed here). Thanks for the clarification, BoBo!
Janusz
Posts: 89
Joined: 18 Dec 2020, 17:47

Re: Help me I'm blind.

08 Sep 2021, 14:24

Dear experts,
I would like to plea you for the script, which will scan paper documents and graphical input will be converted to The plain text file by using the build-in OCR engine from Microsoft, which is The part of the Windows 10 operating system. I Am using flatbet scanner connected by using USB cable. The script would scan by using 300 DPI resolution, contrast and brightness would be set to their default values.
WIA should be used. GUI would be very simple. An only dialog window with buttons start scanning and buttons next page and save results to .txt file. The name of The text output would be constructed by using time and date.
There is only issue. If build in Windows 10 OCR can return its textual output to some variable.
Scripts which are using Windows media ocr are too complex for Me to understand and those scripts are taking Bitmap from screen. Output format can be in .bmp format without compression. Only uncompressed images output are usable to have high quality OCR output.
If there is some kind human beings around. This script would help many not only visually impaired users.
Thank you very much for yours time and help.
Janusz
Posts: 89
Joined: 18 Dec 2020, 17:47

Re: Help me I'm blind.

09 Sep 2021, 06:28

Here is information about my problem.
The following forum thread.
viewtopic.php?t=72674
And The following code has been created by MR Just Me.

Code: Select all

; WIA -> https://docs.microsoft.com/en-us/windows/win32/wia/-wia-startpage
;     -> https://docs.microsoft.com/en-us/previous-versions/windows/desktop/wiaaut/-wiaaut-startpage
; ======================================================================================================================
#NoEnv
FormatID := {BMP: "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}", PNG: "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}"
           , GIF: "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}", JPG: "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"
           , TIF: "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}"}
DevTypes := {0: "UnspecifiedDeviceType"
           , 1: "ScannerDeviceType"
           , 2: "CameraDeviceType"
           , 3: "VideoDeviceType"}
ImgTypes := {0: "WIA_INTENT_NONE"
           , 1: "WIA_INTENT_IMAGE_TYPE_COLOR"
           , 2: "WIA_INTENT_IMAGE_TYPE_GRAYSCALE"
           , 4: "WIA_INTENT_IMAGE_TYPE_TEXT"}
WIA_IPS_PAGE_SIZE := "3097" ; Page Size
WIA_PAGE_A4     := 0 ; 8267 x 11692
WIA_PAGE_LETTER := 1 ; 8500 x 11000
WIA_PAGE_CUSTOM := 2 ; (current extent settings)
WIA_IPS_CUR_INTENT := "6146" ; Current Intent
WIA_INTENT_NONE                 := 0x00000000
WIA_INTENT_IMAGE_TYPE_COLOR     := 0x00000001 ; RGB
WIA_INTENT_IMAGE_TYPE_GRAYSCALE := 0x00000002 ; grayscale
WIA_INTENT_IMAGE_TYPE_TEXT      := 0x00000004 ; black & white
WIA_INTENT_MINIMIZE_SIZE        := 0x00010000
WIA_INTENT_MAXIMIZE_QUALITY     := 0x00020000
WIA_INTENT_BEST_PREVIEW         := 0x00040000
; ----------------------------------------------------------------------------------------------------------------------
; Image output format
FileExt := ""              ; BMP, GIF, JPG, PNG, TIF
; Device name, if required
DeviceName := ""
; Some device and image properties you may set
DevProps := {}
DevProps["3097"] := ""     ; page size (e.g. 0 = A4, 1 = letter, 2 = custom (current extend settings)
ImgProps := {}
ImgProps["3097"] := ""     ; page size (e.g. 0 = A4, 1 = letter, 2 = custom (current extend settings)
ImgProps["6146"] := 1      ; 1 = RGB color, 2 = grayscale, 4 = black & white
ImgProps["6147"] := ""     ; horizontal resolution (DPI)
ImgProps["6148"] := ""     ; vertical resolution (DPI)
ImgProps["6149"] := ""     ; horizontal start position in pixels
ImgProps["6150"] := ""     ; vertical start position in pixels
ImgProps["6151"] := ""     ; horizontal extend (width) in pixels
ImgProps["6152"] := ""     ; vertical extend (height) in pixels
; ----------------------------------------------------------------------------------------------------------------------
; Check the output format
If (FileExt = "")
   FileExt := "BMP"
If !FormatID.Haskey(FileExt) {
   MsgBox, 36, Scan, % "Output format " . FileExt . " is not supported!`n`n"
                     . "Supported formats are  BMP, GIF, JPG, PNG, TIF.`n"
                     . "The image will be scanned as BMP.`n`n"
                     . "Do you want to continue?"
   IfMsgBox, Yes
      FileExt := "BMP"
   Else
      ExitApp
}
; ----------------------------------------------------------------------------------------------------------------------
DevManager := ComObjCreate("WIA.Devicemanager")
DevCount := DevManager.DeviceInfos.Count
I := 0
Device := 0
While (I < DevCount) {
   DevInfo := DevManager.DeviceInfos(++I)
   If (DevInfo.Type = 1) { ; it's a scanner
      If (DeviceName = "") || (DeviceName = DevInfo.Properties("Name").Value) {
         Device := DevInfo.Connect
         Break
      }
   }
}
If !(Device) {
   MsgBox, Could not find a scanner device!
   ExitApp
}
Name := Device.Properties("Name").Value
Item := Device.Items(1)
; ----------------------------------------------------------------------------------------------------------------------
; Set the properties
For Prop, Value In DevProps
   If (Value <> "")
      Device.Properties(Format("{:04}", Prop)).Value := Value
For Prop, Value In ImgProps
   If (Value <> "")
      Item.Properties(Format("{:04}", Prop)).Value := Value
; Item.Properties("3097").Value := 100 ; A4
Image := Item.Transfer("{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}") ; scan as BMP
; MsgBox, % Image.FormatID
PicObj := WIA_GetImageBitmap(Image)
HBM := PicObj.Handle
Gui, Margin, 10, 10
Gui, Add, Pic, w600 h-1 vPic, HBITMAP:%HBM%
GuiControlGet, Pic, Pos
Gui, Show, , Device %DevName% (%PicW%*%PicH%)
Return
; ======================================================================================================================
; Retrieves the bitmap data of the image.
; Return values:
;     A new Picture object on success, otherwise false.
; Note:
;     To retrieve the HBITMAP handle for the returned object use object.Handle
; ======================================================================================================================
WIA_GetImageBitmap(ImgObj) {
   ; To retrieve the HBITMAP handle for the returned object use object.Handle
   Return (ComObjType(ImgObj, "Name") = "IImageFile") ? ImgObj.Filedata.Picture : False
}
; ======================================================================================================================
GuiClose:
ExitApp
[Mod edit: [code][/code] tags added.]
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Help me I'm blind.

09 Sep 2021, 07:35

If You want to recognize image file then use 1 code from ocr topic.
If You want to recognize hBitmap then use 2 code from ocr topic, just replace

Code: Select all

hBitmap := HBitmapFromScreen(GetArea()*)
with Your hBitmap.
And change language to Your language here:

Code: Select all

text := ocr(pIRandomAccessStream, "ru")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], MrDoge and 129 guests