Windows API
#1
Posted 02 June 2012 - 08:48 AM
In linux bash and cmd there are operators to redirect input/output (<,>,|) and I am interested how does solve Windows API this problem. I would like to write some command in ahk to dllcommand. My need is to pass input data (image) into program. So is here anybody who can help me or to refer me on some good page?
#2
Posted 02 June 2012 - 09:29 AM
In AutoHotkey all works trough DllCall.
For AutoHotkey_H you can use WinApi wrapper so you do not need to care about parameter types.
#3
Posted 02 June 2012 - 10:51 AM
I watched the MSDN manual, but cannot to find the answer for redirecting input/output to application (how to call application and to pass the data to it).
I use Autohotkey L, what is the difference from Autohotkey H?
I checked the thread for Autohotkey R but I still miss some basic tutorial for start to work with it or with dllCall.
What I would like to do is to change one line in ScreenCapture.ahk to pass image to ImageMagick (convert.exe) to process it before save. See <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=1&t=87063#p540435">viewtopic.php?f=1&t=87063#p540435</a><!-- l -->
BTW: You have broken link there in this post:
<!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?t=55442#p540390">viewtopic.php?t=55442#p540390</a><!-- l -->
#4
Posted 02 June 2012 - 11:38 AM
It is the same as AHK_L + all listed features, additionally it is available as dll (for multi-threading and use in other programs).
convert.exe requires a file, how do you want to pass data to it?
Is that the link I fixed?
#5
Posted 02 June 2012 - 12:53 PM
What would be needed to do it?
I would try to use a clipboard as channel, but I am not sure it this will not affect performance.
Yes, that is the link that doesn't workIs that the link I fixed?
#6
Posted 02 June 2012 - 05:47 PM
#7
Posted 02 June 2012 - 06:13 PM
The fastest method would be to use conversion functions from a Dll. Those can be accessed through DllCall by AHK. You can pass a HBITMAP to a function that accepts and processes it.
Do you mean GDI+ dll or dll from ImageMagick?
I think it could be very complicated, because ImageMagick is really not simple. It is simple to write some command, but I think it would not be simple to call the inner functions separately. Also I am not expert on IM source, so cannot imaging to manage to do that.
#8
Posted 02 June 2012 - 08:13 PM
#9
Posted 02 June 2012 - 09:44 PM
#10
Posted 03 June 2012 - 08:24 AM
#11
Posted 03 June 2012 - 02:20 PM
#12
Posted 04 June 2012 - 07:07 PM
#13
Posted 04 June 2012 - 08:27 PM
#14
Posted 09 June 2012 - 11:07 AM
Input condition for detection should be color of the pixels and amount of pixels in a group.
For example, if you can look on the blue bar Quick Reply. If it would be color #A67A11, the function should look for this color, and to find all pixels, that are adjacent/neighbouring. The minimum number of pixels in a group would be 8000. So the function would filter all pixels, which are not in the bar. And now would be a decision if the result should keep the original color, even with the text "Quick Reply" or to change whole bar to white, and rest of image would be black. Are there some functions or tutorials how to do something similar?
I know it is possible to save the image from screen and to change it later by ImageMagick, but IM has not this function, that is could detect amount of pixels in a group of pixels. So if there would be some solution in GDI+ or elsewhere, I would use it.
#15
Posted 22 June 2012 - 11:18 PM




