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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
If InitMouse() = 0 Or InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Can't open DirectX 7", 0)
End
EndIf
If OpenWindow(0, 0, 0, 1024, 768, "test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CreateGadgetList(WindowID(0))
ImageGadget(0, 0, 28, WindowWidth(0), WindowHeight(0), 0, #PB_Image_Border)
Filename$ = "Wheel_big.BMP"
If LoadImage(0, Filename$)
SetGadgetState(0, ImageID(0))
ResizeWindow(0, #PB_Ignore, #PB_Ignore, ImageWidth(0)+4, ImageHeight(0)+34)
EndIf
If OpenFile(0, "Log.txt")
FileSeek(0, Lof(0))
WriteStringN(0, FormatDate("Start : %dd/%mm/%yyyy, %hh:%ii:%ss", Date()))
Repeat
EventID = WaitWindowEvent()
ExamineMouse()
x = MouseX() ; Returns actual x pos of our mouse
y = MouseY() ; Returns actual y pos of our mouse
R = Red(point(x,y))
G = Green(point(x,y))
B = Blue(point(x,y))
WriteStringN(0, Str(R)+" " +Str(G)+" "+Str(B))
Delay(20)
Until EventID = #PB_Event_CloseWindow
WriteStringN(0, FormatDate("End : %dd/%mm/%yyyy, %hh:%ii:%ss", Date()))
WriteStringN(0, "")
CloseFile(0)
EndIf
EndIf
End |
Partager