请问:如何实现移动显示出鼠标在屏幕上的xy坐标,及屏幕的颜色值?
请问:如何实现移动显示出鼠标在屏幕上的xy坐标,及屏幕的颜色值?
如何实现移动显示出鼠标在屏幕上的xy坐标:AMOUSEOBJ()
屏幕的颜色值:POINT方法
自己研究吧
CLEAR ALL Main() CLEAR ALL RETURN PROCEDURE Main() LOCAL loForm loForm = CREATEOBJECT("_Form") WITH loForm .Caption = "Test4" .BorderStyle = 1 .WindowState = 2 .Image1.Picture = "1127364.JPG" .Show ENDWITH READ EVENTS ENDPROC PROCEDURE ColorToRGB(tnColor, tnRed, tnGreen, tnBlue) tnBlue = BITRSHIFT(tnColor, 16) tnGreen = MOD(BITRSHIFT(tnColor, 8), 256) tnRed = MOD(tnColor, 256) ENDPROC DEFINE CLASS _Form AS Form ADD OBJECT Image1 AS Image WITH Stretch = 1 ADD OBJECT Label1 AS Label WITH Caption = "坐标:", Height = 25, Width = 60, Alignment = 1 ADD OBJECT Text1 AS TextBox WITH Height = 25, Width = 80, Enabled = .F. ADD OBJECT Label2 AS Label WITH Caption = "RGB颜色:", Height = 25, Width = 80, Alignment = 1 ADD OBJECT Text2 AS TextBox WITH Height = 25, Width = 100, Enabled = .F. PROCEDURE Arrange WITH This.Label1 .Top = This.Height - .Height - 5 .Left = 5 ENDWITH WITH This.Text1 .Top = This.Label1.Top .Left = This.Label1.Left + This.Label1.Width ENDWITH WITH This.Label2 .Top = This.Text1.Top .Left = This.Text1.Left + This.Text1.Width + 5 ENDWITH WITH This.Text2 .Top = This.Label2.Top .Left = This.Label2.Left + This.Label2.Width ENDWITH WITH This.Image1 .Top = 5 .Left = 5 .Height = This.Label1.Top - .Top - 5 .Width = This.Width - .Left - 5 ENDWITH ENDPROC PROCEDURE Activate This.Arrange ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC PROCEDURE Image1.MouseMove(tnButton, tnShift, tnXCoord, tnYCoord) LOCAL lnRed, lnGreen, lnBlue ColorToRGB(ThisForm.Point(tnXCoord, tnYCoord), @lnRed, @lnGreen, @lnBlue) WITH This.Parent .Text1.Value = "(" + TRANSFORM(tnXCoord) + "," + TRANSFORM(tnYCoord) + ")" .Text2.Value = "(" + TRANSFORM(lnRed) + "," + TRANSFORM(lnGreen) + "," + TRANSFORM(lnBlue) + ")" ENDWITH ENDPROC ENDDEFINE