private void paintTopSide( Highlighters control, int border, NativeMethods.CursorPoint p, double height, double width, Color?color) // System.Nullable<System.Drawing.Color> color) { topSide = new Side(p.X, p.Y - (border / 2), width, border, control, color); }
// [STAThread] // internal void CreateToolTip(string highlighterData) // { // // painting a new form // int left = // this.rightSide.Left - 20; // int top = // this.bottomSide.Top - 15; // int height = // this.bottomSide.Top - top; // int width = // this.rightSide.Left - left; // // labelForm = // new LabelForm( // left, // top, // width, // height, // highlighterNumber, // this.bottomSide.BackColor); // } private NativeMethods.CursorPoint getPoint( double X, double Y, int intHandle) { var p = new NativeMethods.CursorPoint { X = (int)X, Y = (int)Y }; if (intHandle == 0) { return(p); } try { // Windows Vista or higher only var handle = new IntPtr(intHandle); NativeMethods.PhysicalToLogicalPoint(handle, ref p); } catch { } /* * NativeMethods.CursorPoint p = new NativeMethods.CursorPoint {X = (int) X, Y = (int) Y}; * if (intHandle == 0) return p; * try { // Windows Vista or higher only * IntPtr handle = * new IntPtr(intHandle); * NativeMethods.PhysicalToLogicalPoint(handle, ref p); * } * catch { * } */ /* * if (intHandle != 0) { * try { // Windows Vista or higher only * IntPtr handle = * new IntPtr(intHandle); * NativeMethods.PhysicalToLogicalPoint(handle, ref p); * } * catch { * } * } */ return(p); }
private void createHighlighter( double height, double width, double X, double Y, int intHandle, Highlighters control, Color?color) { try { if (height == 0 || width == 0) { return; } int border = getBorder(control); NativeMethods.CursorPoint p = getPoint( X, Y, intHandle); //; paintLeftSide(control, border, p, height, width, color); paintTopSide(control, border, p, height, width, color); paintRightSide(control, border, p, height, width, color); paintBottomSide(control, border, p, height, width, color); /* * if (height != 0 && width != 0) { * * int border = getBorder(control); * NativeMethods.CursorPoint p = * getPoint( * X, * Y, * intHandle);; * * this.paintLeftSide(control, border, p, height, width, color); * this.paintTopSide(control, border, p, height, width, color); * this.paintRightSide(control, border, p, height, width, color); * this.paintBottomSide(control, border, p, height, width, color); * } */ } catch { //(Exception eHighlighter) { } }