[DllImport("user32.dll")] private static extern IntPtr GetDC(IntPtr hwnd); [DllImport("gdi32.dll")] private static extern int GetPixel(IntPtr hdc, Point p); public static Color getColor(Point p) { // Point p = new Point(MousePosition.X
1:div相对屏幕的坐标位置 function getDivPosition(div){ var x = div.getBoundingClientRect().left; var y = div.getBoundingClientRect().top; return {x:x,y:y}; } 参数传js原生对象 getDivPosition($('#div0')[0]).x getDivPosition($('#div0')[0]).y