English
Forum

AutoItX3.dll - PixelSearch Funktionsaufruf

 
- Page 1 -



Christian
Schneider
Hi,

I stand unfortunately time again on Kriegsfuß with of/ one .dll. this time is it The AutoItX3.dll.
i want The function AU3_PixelSearch Call.
CompileMarkSeparation
CLS
Declare autodll&
autodll&=UseDll(AutoItX3.dll)
importFunc(autodll&,AU3_PixelSearch,PixelSearch)
Pixelsearch(???????????)
FreeDLL autodll&
Waitk

How should now the suitable appeal looks? The Doku says:

AU3_API void WINAPI AU3_PixelSearch(long nLeft, long nTop, long nRight, long nBottom, long nCol, /*default 0*/long nVar, /*default 1*/long nStep, LPPOINT pPointResult);


I come simply not further. Dll and Help hang on the Posting on.

Greeting Christian

186 kB
Hochgeladen:02/23/09
Downloadcounter237
Download
306 kB
Hochgeladen:02/23/09
Downloadcounter185
Download
 
XProfan 11| Vista(64) SP2
02/23/09  
 



 
- Page 3 -


The Doku The I moreover found contained solely whom already supra einkopierten appeal with Parameters - have nothing so right found and therefore too The Solution with reinem XProfan prepares. (which explicit faster as The DLL works ought to/could.)
 
02/25/09  
 




Thomas
Freier
by me exits The pixelSearch.exe itself same at started.

10 kB
Hochgeladen:02/25/09
Downloadcounter113
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
02/25/09  
 



One SS.BMP lying in the way?
 
02/25/09  
 




Thomas
Freier
No, I had forgotten. now goes it and right zügig (17.5MB). would be however whom first weissen Pixel on another place suppose, z.B.: with whom Sonnenschirmen. Reduced example. Fundort is identical x=609, y=398.

1.203 kB
Hochgeladen:02/25/09
Downloadcounter169
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
02/25/09  
 




Christian
Schneider
RGH
Hi,

On what relating the Coordinates, in them sought becomes? relating which on the Desktop, irgenein Window, irgenmdeine Bitmap, or what integrally other?


I suspect time on the Desktop. of course there in AutoIt self with the function a optionalen Parameter for a lever, however standing this in the .dll apparently not available (at least not in the function self / Notes on a Einstellmöglichkeit by another function could I ditto not find).

RGH
there The DLL, How supra written standing, evident initialized go must, must tappt im dunkeln naturally too zuallererst with UseDLL into memory loaded go. is tappt im dunkeln this not, would tappt im dunkeln of course when calling the Init-function into WinXP? loaded, The function carryed out, but subsequently immediate again entladen will be. then would The Initialisierung for Katz!


I must confess the was me yet not deliberate. have already a little bit on this Base herumprobiert, however with the equal Result How yet.

RGH
i'd suppose, that to the appeal of AU3_PixelSearch first others Aufrufe erfolgen must, so what there's, in the sought go can.


How supra written could I hereon none Info find. of course there some Options everybody can by AutoItSetOption settle could, however nothing what really fit. Also is always one Default-worth present.
 
XProfan 11| Vista(64) SP2
02/25/09  
 



I had forget a code  [...]  To post.
 
03/03/09  
 




Christian
Schneider
thanks. same time reading.
 
XProfan 11| Vista(64) SP2
03/04/09  
 




Christian
Schneider
The code runs by me in the Originalzustand without Problems.

now goes it me therefore several Farbvorkommen to find (if present). but this is not the eigentliche trouble. can someone begreiflich make Why the following 1. code runs and the 2. not?

1:
CompileMarkSeparation
CLS
var HPIC&=CREATE(hNewPic,1024,1024,0)
var X&=RND(1024)
var Y&=RND(1024)
var COL&=$00FF00
STARTPAINT HPIC&
SETPIXEL X&,Y&,COL&
ENDPAINT
Declare SOMEPOS&
SOMEPOS&=HPIC.PIXELSEARCH(HPIC&,COL&,1024,1024)
SOMEPOS&=HPIC.PIXELSEARCH(HPIC&,COL&,1024,1024)
PRINT X&,Y&
PRINT HIWORD(SOMEPOS&),LOWORD(SOMEPOS&)
WAITINPUT
END

proc HPIC.BGR2STRING

    PARAMETERS H&,_WIDTH&,_HEIGHT&
    var SZ&=( (_WIDTH&*328-1) | 3 +1) * ABS(_HEIGHT&)
    DECLARE MEM#
    DIM MEM#,BITMAPINFOHEADER

    WITH MEM#

        .BISIZE&=SIZEOF(MEM#)
        .BIWIDTH&=_WIDTH&
        .BIHEIGHT&=_HEIGHT&
        .BIPLANES%=1
        .BIBITCOUNT%=32
        .BICOMPRESSION&=0
        .BISIZEIMAGE&=SZ&

    ENDWITH

    DECLARE DATA#
    DIM DATA#,SZ&
    var RET$=

    IF ~GetDIBits(%HDC,H&,0,_HEIGHT&,DATA#,MEM#,0)

        RET$=CHAR$(DATA#,0,SZ&)

    ENDIF

    DISPOSE DATA#
    DISPOSE MEM#
    RETURN +RET$

endproc

proc HPIC.PIXELSEARCH

    PARAMETERS H&,COLORTOFIND&,_WIDTH&,_HEIGHT&
    var RAWDATA$=HPIC.BGR2STRING(H&,_WIDTH&,_HEIGHT&)
    var _FND&=HPIC.FINDCOLORINRAWDATA(COLORTOFIND&,RAWDATA$)

    IF _FND&=-1

        RETURN _FND&

    ENDIF

    var X&=_FND& MOD _WIDTH&
    var Y&=0

    IF _FND& > 0

        Y&=_FND&\_WIDTH&

    ENDIF

    RETURN X&*65536+(_HEIGHT&-Y&-1)

endproc

proc HPIC.FINDCOLORINRAWDATA

    PARAMETERS COL&,DATA$
    var C&=1
    var P&=0
    var SCOL$=CHR$(GETBVALUE(COL&))+CHR$(GETGVALUE(COL&))+CHR$(GETRVALUE(COL&))

    WHILE 1

        P&=INSTR(SCOL$,DATA$,C&)

        IFNOT P&

            BREAK

        ENDIF

        IFNOT (P&-1) MOD 4

            RETURN P&*0.25

        ENDIF

        C&=P&+1

    ENDWHILE

    RETURN -span class=s2>1

endproc


2:
CompileMarkSeparation
 $H windows.ph
STRUCT BITMAPINFOHEADER=BISIZE&,BIWIDTH&,BIHEIGHT&,BIPLANES%,BIBITCOUNT%,BICOMPRESSION&,BISIZEIMAGE&,BIXPELSPERMETER&,BIYPELSPERMETER&,BICLRUSED&,BICLRIMPORTANT&
RANDOMIZE
CLS
var HPIC&=CREATE(hNewPic,1024,1024,0)
var X&=RND(1024)
var Y&=RND(1024)
var COL&=$00FF00
STARTPAINT HPIC&
SETPIXEL X&,Y&,COL&
ENDPAINT
Declare SOMEPOS&

Whileloop 2

    SOMEPOS&=HPIC.PIXELSEARCH(HPIC&,COL&,1024,1024)

Endwhile

PRINT X&,Y&
PRINT HIWORD(SOMEPOS&),LOWORD(SOMEPOS&)
WAITINPUT
END

proc HPIC.BGR2STRING

    PARAMETERS H&,_WIDTH&,_HEIGHT&
    var SZ&=( (_WIDTH&*328-1) | 3 +1) * ABS(_HEIGHT&)
    DECLARE MEM#
    DIM MEM#,BITMAPINFOHEADER

    WITH MEM#

        .BISIZE&=SIZEOF(MEM#)
        .BIWIDTH&=_WIDTH&
        .BIHEIGHT&=_HEIGHT&
        .BIPLANES%=1
        .BIBITCOUNT%=32
        .BICOMPRESSION&=0
        .BISIZEIMAGE&=SZ&

    ENDWITH

    DECLARE DATA#
    DIM DATA#,SZ&
    var RET$=

    IF ~GetDIBits(%HDC,H&,0,_HEIGHT&,DATA#,MEM#,0)

        RET$=CHAR$(DATA#,0,SZ&)

    ENDIF

    DISPOSE DATA#
    DISPOSE MEM#
    RETURN +RET$

endproc

proc HPIC.PIXELSEARCH

    PARAMETERS H&,COLORTOFIND&,_WIDTH&,_HEIGHT&
    var RAWDATA$=HPIC.BGR2STRING(H&,_WIDTH&,_HEIGHT&)
    var _FND&=HPIC.FINDCOLORINRAWDATA(COLORTOFIND&,RAWDATA$)

    IF _FND&=-1

        RETURN _FND&

    ENDIF

    var X&=_FND& MOD _WIDTH&
    var Y&=0

    IF _FND& > 0

        Y&=_FND&\_WIDTH&

    ENDIF

    RETURN X&*65536+(_HEIGHT&-Y&-1)

endproc

proc HPIC.FINDCOLORINRAWDATA

    PARAMETERS COL&,DATA$
    var C&=1
    var P&=0
    var SCOL$=CHR$(GETBVALUE(COL&))+CHR$(GETGVALUE(COL&))+CHR$(GETRVALUE(COL&))

    WHILE 1

        P&=INSTR(SCOL$,DATA$,C&)

        IFNOT P&

            BREAK

        ENDIF

        IFNOT (P&-1) MOD 4

            RETURN P&*0.25

        ENDIF

        C&=P&+1

    ENDWHILE

    RETURN -1

endproc


The Difference lying therein the in the 1. example The Suchfunktion 2x called becomes
CompileMarkSeparation
SOMEPOS&=HPIC.PIXELSEARCH(HPIC&,COL&,1024,1024)
SOMEPOS&=HPIC.PIXELSEARCH(HPIC&,COL&,1024,1024)

and in the 2. example ditto, though by Whileloop
CompileMarkSeparation
Whileloop 2

    SOMEPOS&=HPIC.PIXELSEARCH(HPIC&,COL&,1024,1024)

Endwhile


in the 2. example I will hereon hingewiesen the Scol$ not declared be, though of understanding since the same occur ought to. naturally power the double appeal none sense. These mutants are solely to Fehlersuche emerged.
 
XProfan 11| Vista(64) SP2
03/04/09  
 



I have tested 2 time aufzurufen + works. On The speedy could I in Your example whom Error not discern.
CompileMarkSeparation
If it then later ums find more Pixel goes would I hPic.bgr2String only einmalig Call.
 
03/04/09  
 




Jörg
Sellmeyer
look time in the Help under Return to:



important: even if a procedure with Return leave becomes, must The Definition the procedure with ENDPROC completed go. the leave of/ one procedure must not within of/ one While-/Repeat-Loop erfolgen.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
03/04/09  
 




Christian
Schneider
thanks, the declared some.
 
XProfan 11| Vista(64) SP2
03/04/09  
 



Tjupp, must I updaten.
 
03/05/09  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

22.999 Views

Untitledvor 0 min.
Normann Strübli06/09/20
Walter12/31/18
Peter Max Müller12/19/17
E.T.12/12/15
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie