hey,
ik ben bezig met een klein proggie om de kleur van de locatie van de cursor (kleur onder de cursor dus) te achterhalen.
Nu heb ik me helemaal rot gezocht, op google, codeguru, mdsn, GoT etc, en ik heb nu dit:
nu geeft het stukje code in de messagebox altijd "9222812406911074303" terug, wat dus al niet kan kloppen.
Het 2de probleem is dat ik nergens wat vind om Long te converteren naar een system.drawing.color.
ik ben bezig met een klein proggie om de kleur van de locatie van de cursor (kleur onder de cursor dus) te achterhalen.
Nu heb ik me helemaal rot gezocht, op google, codeguru, mdsn, GoT etc, en ik heb nu dit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| <StructLayout(LayoutKind.Sequential)> _
Private Structure POINTAPI
Dim x As Int32
Dim y As Int32
End Structure
Private Declare Function GetCursor Lib "user32" () As Int32
Private Declare Function GetCursorPos Lib "user32"
Alias "GetCursorPos" (ByRef lpPoint As POINTAPI) As Int32
Private Declare Function WindowFromPoint Lib "user32"
(ByVal xPoint As Int32, ByVal yPoint As Int32) As Int32
Public Declare Function GetPixel Lib "gdi32"
Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long)
As Long
Public Declare Function GetDC Lib "user32"
Alias "GetDC" (ByVal hwnd As Long) As Long
Dim clr As Long
GetCursorPos(pt)
Dim myWin = WindowFromPoint(pt.x, pt.y)
Dim myDC = GetDC(myWin)
MessageBox.Show(GetPixel(myDC, pt.x, pt.y)) |
nu geeft het stukje code in de messagebox altijd "9222812406911074303" terug, wat dus al niet kan kloppen.
Het 2de probleem is dat ik nergens wat vind om Long te converteren naar een system.drawing.color.
[ Voor 12% gewijzigd door Rhapsody op 08-05-2003 22:04 . Reden: layout ]
🇪🇺 pro Europa!