06. marts 2001 - 15:22Der er
3 kommentarer og 1 løsning
GetPixel
Jeg har lavet et lille program der ser sådan her ud:
\'---------- modul: --------------------- Public Declare Function WindowFromPoint Lib \"user32\" (ByVal xPoint As Long, ByVal yPoint As Long) As Long Public Declare Function GetCursorPos Lib \"user32\" (lpPoint As POINTAPI) As Long Public Declare Function GetPixel Lib \"gdi32\" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long Public Declare Function GetWindowDC Lib \"user32\" (ByVal wnd As Long) As Long
Public Type POINTAPI x As Long y As Long End Type
public P as pointapi public tmpVal as long \'---------form-----------------------
hmm...hoejrup jeg ved ikke hvad du snakker om ;) (se koden) Det er jo osse getpixel som var problemet men nu har jeg selv fundet en løsning :) Her kommer koden hvis andre for brug/har for den:
\'-------modul--------- Public Declare Function WindowFromPoint Lib \"user32\" (ByVal xPoint As Long, ByVal yPoint As Long) As Long Public Declare Function GetCursorPos Lib \"user32\" (lpPoint As POINTAPI) As Long Public Declare Function GetPixel Lib \"gdi32\" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long Public Declare Function GetWindowDC Lib \"user32\" (ByVal wnd As Long) As Long Public Declare Function GetWindowRect Lib \"user32.dll\" (ByVal hwnd As Long, lpRect As RECT) As Long
Public Type POINTAPI x As Long y As Long End Type
Public Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
\'--------form--------- Private Sub Timer1_Timer() Dim tmpval As Long Dim r As RECT Dim retval As Long
Dim P As POINTAPI k$ = GetCursorPos(P) j$ = WindowFromPoint(P.x, P.y)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.