Verfasst: 14.09.2006 21:05
Vernünftige Haltung! Ich lege es natürlich auf nicht darauf an, bin froh, den Link erhalten zu haben. Download uns Installation verliefen erfolgreich, werde es gleich sofort testen.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
Procedure FindPixel(WindowName.s,x1,y1,x2,y2,colour)
WindowID = FindWindow_(0, WindowName)
For a=x1 To x2
For b=y1 To y2
Color=GetPixel_(GetDC_(WindowID),a,b)
Debug Hex(Color)
If Color=Colour
Debug Str(x1)+" "+Str(x2)
EndIf
Next
Next
EndProcedure
Code: Alles auswählen
Global WindowID
Procedure FindPixel(WindowName.s,x1,y1,x2,y2,colour.s)
WindowID = FindWindow_(0, WindowName)
If WindowID=0:End:EndIf
Repeat:Delay(1):Until GetForegroundWindow_()=WindowID
Delay(1000)
For a=x1 To x2
For b=y1 To y2
Color=GetPixel_(GetDC_(WindowID),a,b)
;Debug "x: "+Str(a)+" y: "+Str(b)+" Color: "+Hex(Color)
If Hex(Color)=Colour
Debug Str(x1)+" "+Str(x2)
EndIf
Next
Next
EndProcedure
;z.b.
FindPixel("LOL - Nachrichtensitzung",1,1,50,50,"FFFF00")
und Hex(#CLR_INVALID) ist FFFFFFFFIf the pixel is outside of the current clipping region, the return value is CLR_INVALID
Ja aber das komische ist ja das es nicht außerhalb ist#NULL hat geschrieben:GetPixel:und Hex(#CLR_INVALID) ist FFFFFFFFIf the pixel is outside of the current clipping region, the return value is CLR_INVALID
Code: Alles auswählen
OpenWindow(0, 100,400,100,100,"lala")
Procedure FindPixel(WindowName.s,x1,y1,x2,y2,Colour)
WindowID = FindWindow_(0, WindowName)
For a=x1 To x2
For b=y1 To y2
Color=GetPixel_(GetDC_(WindowID),a,b)
Debug Str(a)+","+Str(b)+" "+Str( Red(color) )+", "+Str( Green(color) )+", "+Str( Blue(color) )+" $"+Hex(color)
If Color=Colour
Debug " aha !! @"+Str(a)+" "+Str(b)
EndIf
Next
Next
EndProcedure
FindPixel("lala", 50,50, 51,50, RGB(224,223,227) )
Repeat :: Until WindowEvent()=#PB_Event_CloseWindow
Code: Alles auswählen
If Hex(Color)=Colour
Debug Str(x1)+" "+Str(x2)
EndIf