Пример #1
0
        public FloatPoint Limit(FloatPoint min, FloatPoint max)
        {
            var result = this.Clone();

            result.X = result.X.MinMax(min.X, max.X).ToSingle();
            result.Y = result.Y.MinMax(min.Y, max.Y).ToSingle();
            return(result);
        }
Пример #2
0
        static public FloatPoint Average(params FloatPoint[] xp)
        {
            FloatPoint p = new FloatPoint(0);

            foreach (FloatPoint pt in xp)
            {
                p += pt;
            }
            return(p / xp.Length);
        }
Пример #3
0
        public static void DoCircle(Graphics gfx, Pen pen, float phase, FloatPoint O, int M, int R)
        {
            for (float i=-M;i<M;i++)
              {
            double ox = -Math.Sin(cvt(M,i+phase));
            double oy = Math.Cos(cvt(M,i+phase));
            double nx = -Math.Sin(cvt(M,i+1+phase));
            double ny = Math.Cos(cvt(M,i+1+phase));

            gfx.DrawLine( pen, (float)(ox*R)+O.X,(float)(oy*R)+O.Y, (float)(nx*R)+O.X,(float)(ny*R)+O.Y );
              }
        }
Пример #4
0
 /// ? Not quite sure if this works
 /// <returns></returns>
 /// <param name="PhaseOffset">
 /// Zero-Point or the offset from N=0.
 /// Positive moves from north to east at circumference.
 /// </param>
 /// <param name="CircumferencePoints">Number of Points on the path</param>
 /// <param name="Radius">Radius</param>
 public static System.Drawing.Drawing2D.GraphicsPath CirclePath(FloatPoint PhaseOffset, int CircumferencePoints, int Radius)
 {
     var P = new PointF[Radius];
       var T = new byte[Radius];
       for (int i=0; i < CircumferencePoints; i++)
       {
     FloatPoint point = CirclePoint(i,CircumferencePoints)+PhaseOffset;
     /*double ox = -Math.Sin(cvt(M,i)), oy = Math.Cos(cvt(M,i)); P[i]=new FloatPoint((float)(ox*R)+O.X,(float)(oy*R)+O.Y); T[i] = (byte)PatFPointType.Line;*/
       }
       T[0] = (byte)System.Drawing.Drawing2D.PathPointType.Start;
       T[T.Length-1] = (byte)System.Drawing.Drawing2D.PathPointType.CloseSubpath;
       return new System.Drawing.Drawing2D.GraphicsPath(P,T);
 }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dest"></param>
        /// <param name="source"></param>
        /// <param name="ScaleFlagBit"> 0x00 | (width) 0x01 | (height) 0x02 = 0x03 so you can check both width and height bits with a value of three.</param>
        /// <returns></returns>
        static public FloatPoint Fit(FloatPoint dest, FloatPoint source, int ScaleFlagBit)
        {
            FloatPoint HX = dest / source;

            if (ScaleFlagBit == 0)
            {
                return(Fit(dest, source, 1));
            }
            else
            {
                return((ScaleFlagBit == 1) ? source * HX.X : source *HX.Y);
            }
        }
Пример #6
0
 private Point Pt2Px(FloatPoint point)
 {
     var edge = new double[,] { { -18.88, -9.44 }, { 18.88, 9.44 } };
     var image = new double[,] { { 0, 0 }, { 4096, 2048 } };
     var widthRatio = (edge[1, 0] - edge[0, 0]) / (image[1, 0] - image[0, 0]);
     var heightRatio = (edge[1, 1] - edge[0, 1]) / (image[1, 1] - image[0, 1]);
     double x = (point.X - 37.76 / 2)/widthRatio;
     if (x<0)
         x+=4096;
     if (x>4096)
         x-=4096;
     var y=(int)((point.Y+edge[1, 1]) / heightRatio);
     return new Point()
     {
         X = (int)x,
         Y = 2048-y
     };
 }
Пример #7
0
   /// <summary>use Flat or flatten calls.</summary>
   public FloatPoint ScaleTo(FloatPoint point)
   {
       if (point.X == X && point.Y == Y)
       {
           throw new InvalidOperationException("you mucker");
       }
       System.Windows.Forms.MessageBox.Show(string.Format("X: {1},Y: {0}", Y / point.Y, X / point.X));
       if (X > point.Y)
       {
   #if CONSOLE && COR3
           Global.cstat(ConsoleColor.Red, "X is BIGGER");
   #else
           Debug.Print("X is BIGGER");
   #endif
       }
 #if CONSOLE && COR3
       else
       {
           Global.cstat(ConsoleColor.Red, "X is SMALLER");
       }
Пример #8
0
        /// <summary>
        /// Approximates: PianoCalculator, Key, Count, Quarter and Pulse.
        /// Also acts as storage for LoopPoint (piano-view transport or 
        /// buffer-transport).
        /// </summary>
        /// <param name="clientMouse">(stored); ClientInput</param>
        /// <param name="loopRegion">(stored); LoopRegion</param>
        /// <param name="pxNode">(ref) ignored after usage (only referenced)</param>
        /// <param name="wedge">(stored); Typically (in local terms): pxNode.X * 4 * 4</param>
        /// <param name="multiply">(stored); Typically 4</param>
        /// <param name="division">(stored); From sequencer or midi program</param>
        /// <param name="upper">(stored); Top visible midi key. (Key and Count values are provided from this value in relation to clientMouse)</param>
        public NoteTransport(
			FloatPoint clientMouse,
			LoopPoint loopRegion,
			FloatPoint pxNode,
			double wedge,
			double multiply,
			double division,
			double upper)
        {
            this.ClientInput = clientMouse;
            this.loopRegion = loopRegion;
            this.pianoInfo = PianoCalculator.Create(clientMouse,pxNode.X*4);
            this.wedge = wedge; // nodewidth * 4 * 4
            this.multiply = multiply; // 4
            this.division = division;
            //                           quarter    bar
            //                                  beat    measure
            // wedge * multiply  ==  nodewidth * 4 * 4 * 4
            Quarter = ClientInput.X / wedge * multiply;
            Pulse = GetPulses(division);
            Upper = upper;
            Key = Upper.ToInt32() - Convert.ToDouble(ClientInput.Y/pxNode.Y).FloorMinimum(0).ToInt32();
            Count = Convert.ToDouble(pxNode.Y).FloorMinMax(0,127).ToInt32()-1;
        }
Пример #9
0
 public static void DoCircle(Graphics gfx, Pen pen, FloatPoint O, int M, int R)
 {
     DoCircle(gfx,pen,0,O,M,R);
 }
Пример #10
0
 public static FloatPoint CenteredX(FloatPoint xp, double max_radius, double velocity)
 {
     double velo = (velocity/1024) * max_radius;
       return xp - (velo*.5F);
 }
Пример #11
0
 public static FloatPoint[] CirclePoints(float phase, FloatPoint box_dimension, FloatPoint size, int _count)
 {
     var points = new List<FloatPoint>();
       for (float i=0;i<_count;i++) points.Add(CirclePoint(i,_count,phase));
       return points.ToArray();
 }
Пример #12
0
 public static bool HitTest(FloatPoint Center, float CircleRadius, FloatPoint TestPoint)
 {
     FloatPoint
     newPoint = Center-TestPoint,
       maxPoint = HitTestMaxPoint(Center,CircleRadius),
       minPoint = HitTestMinPoint(Center,CircleRadius);
       return newPoint.Slope <= new FloatPoint(CircleRadius).Slope;
       //double Slope = newPoint.Slope;
       //        return ( TestPoint.IsLEq(maxPoint) ) && ( TestPoint.IsGEq(minPoint) );
 }
Пример #13
0
        // WTF?
        public static FloatPoint[] ScalePoints(FloatPoint box, FloatPoint size, int _count, float scale_by)
        {
            var points = new List<FloatPoint>();
              FloatPoint scale = FloatPoint.FlattenPoint(box,false);

              for (float i=-_count;i<_count;i++)
              {
            points.Add(scale * scale_by*0.5f);
              }
              return points.ToArray();
        }
Пример #14
0
 public UPointD(FloatPoint value)
     : this((decimal)value.X,(decimal)value.Y)
 {
 }
Пример #15
0
 public static void ElipseToPath(System.Drawing.Drawing2D.GraphicsPath gp, FloatPoint xp, int rad_max, int velo)
 {
     ElipseToPath(gp,xp,(double)rad_max,(double)velo);
 }
Пример #16
0
 /// <summary>Flattens the calling point</summary>
 public void Flatten(bool roundUp)
 {
     FloatPoint f = Flat(roundUp); this.X = f.X; this.Y = f.Y; f = null;
 }
Пример #17
0
 public bool Contains(FloatPoint point)
 {
     return(point >= this.Location && point <= this.BottomRight);
 }
Пример #18
0
 public FloatPoint GetRation(FloatPoint dst)
 {
     return(dst / this);
 }
Пример #19
0
 public FloatPoint GetScaledRation(FloatPoint dst)
 {
     return(this * (dst / this));
 }
Пример #20
0
 /*		/// todo: replace this with something more accurate and faster
  *          /// use Boxed as the default scale flag
  *          static public HPoint Fit(Point dest, Point source, scaleFlags sf)
  *          {
  *                  HPoint skaler = new HPoint();
  *                  float tr=0;
  *                  string omax,cmax;
  *                  if (source.X >= source.Y) omax = "width"; else omax="height";
  *                  if (dest.X >= dest.Y) cmax = "width"; else cmax="height";
  *                  switch (cmax)
  *                  {
  *                          case "width": if (omax==cmax) sf = scaleFlags.sWidth; else sf = scaleFlags.sHeight; break;
  *                          case "height": if (omax==cmax) sf = scaleFlags.sHeight; else sf = scaleFlags.sWidth; break;
  *                  }
  *          skale:
  *                  switch (sf)
  *                  {
  *                          case scaleFlags.sHeight:
  *                                  if ( source.Y > dest.Y ) { skaler.Y = dest.Y; tr = (float)((float)dest.Y / (float)source.Y); skaler.X = (int)Math.Round(source.X*tr); }
  *                                  else skaler = source; break;
  *                          case scaleFlags.sWidth:
  *                                  if ( source.X > dest.X ) { skaler.X = dest.X; tr = (float)((float)dest.X / (float)source.X); skaler.Y = (int)Math.Round(source.Y*tr); }
  *                                  else skaler = source; break;
  *                  }
  *                  if ((skaler.X > dest.X) | (skaler.Y > dest.Y))
  *                  {
  *                          switch (sf)
  *                          {
  *                                  case scaleFlags.sWidth: sf = scaleFlags.sHeight; goto skale;
  *                                  case scaleFlags.sHeight: sf = scaleFlags.sWidth; goto skale;
  *                          }
  *                  }
  *                  return skaler;
  *          }*/
 #endregion
 #endregion
 #region Help
 //		public XPoint Translate(XPoint offset, XPoint zoom, bool ZoomAfterOffset, bool MultiplyOffset)
 //		{
 //			return (ZoomAfterOffset) ? (this+((MultiplyOffset) ? offset*zoom : offset ))*zoom : (this*zoom)+((MultiplyOffset) ? offset*zoom : offset );
 //		}
 /// <summary>
 /// Note that this is not a suggested optimal translation.
 /// The relation of most transforms should be provided via
 /// the context of the window or container.
 /// </summary>
 /// <param name="offset"></param>
 /// <param name="zoom"></param>
 /// <returns></returns>
 public FloatPoint Translate(FloatPoint translateOffset, FloatPoint translateZoom)
 {
     return((this + translateOffset) * translateZoom);
 }
Пример #21
0
 static public FloatPoint FlattenPoint(FloatPoint _pin)
 {
     return(FlattenPoint(_pin, false));
 }
Пример #22
0
 /// scales src to dest
 static public FloatPoint Fit(FloatPoint dest, FloatPoint source)
 {
     return(Fit(dest, source, 0));
 }
Пример #23
0
 public static void DrawCircleOutlines(Graphics gfx, Pen pen, float phase, FloatPoint box_dimension, FloatPoint size, int _count, float scale_by)
 {
     FloatPoint Offset = box_dimension * 0.5f;
       FloatPoint scale = FloatPoint.FlattenPoint(box_dimension,false);
       FloatRect render_rect = new FloatRect(Offset,size);
       FloatPoint[] points = CirclePoints(phase,box_dimension,size,_count);
       FloatPoint scaler = scale * (scale_by*0.5f);
       for (int i=0;i<points.Length;i++)
       {
     FloatPoint Position = new FloatPoint(
       (float)(-Math.Sin(cvtf(_count,i+phase))) ,
       (float)(Math.Cos(cvtf(_count,i+phase)))
      );
     render_rect.Location = Offset+(Position*scaler)-(size*0.5f);
     gfx.DrawEllipse(pen,render_rect);
       }
 }
Пример #24
0
 public FloatRect(FloatPoint L, FloatPoint S) : this(L.X, L.Y, S.X, S.Y)
 {
 }
Пример #25
0
 void Render(Graphics g)
 {
     FloatPoint h = HalfPoint;
     string value = string.Format("{0:N0}x{1:N0}",ClientSize.Width,ClientSize.Height);
     FloatPoint posText = new FloatPoint(0,HalfPoint.Y);
     posText.Y -= HalfLineHeight;
     using (Pen line = new Pen(LineColor,1)) g.DrawLine(line,0,h.Y,ClientSize.Width,h.Y);
     using (Brush fg = new SolidBrush(BackColor)) g.DrawString(value,Font,fg,posText+-2);
     using (Brush fg = new SolidBrush(BackColor)) g.DrawString(value,Font,fg,posText+2);
     using (Brush fg = new SolidBrush(LineColor)) g.DrawString(value,Font,fg,posText);
 }
Пример #26
0
 /// <summary>
 /// X &lt; input.X ? X : input.X, Y &lt; input.Y ? Y : input.Y
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 public FloatPoint Nearest(FloatPoint input)
 {
     return(new FloatPoint(X < input.X ? X : input.X, Y < input.Y ? Y : input.Y));
 }
Пример #27
0
 static public FloatPoint FlattenUp(FloatPoint _pin)
 {
     return(FlattenPoint(_pin, true));
 }
Пример #28
0
 /// <summary>
 /// FloatPoint(X &gt; input.X ? X : input.X, Y &gt; input.Y ? Y : input.Y)
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 public FloatPoint Furthest(FloatPoint input)
 {
     return(new FloatPoint(X > input.X ? X : input.X, Y > input.Y ? Y : input.Y));
 }
Пример #29
0
 public static void ElipseToPath(System.Drawing.Drawing2D.GraphicsPath gp, FloatPoint xp, double rad_max, double velo)
 {
     FloatPoint pnew = Centered(xp,rad_max,velo);
       FloatPoint hp = GetPressureRadius(rad_max,velo);
       gp.AddEllipse(xp.X-hp.X,xp.Y-hp.Y,hp.X,hp.Y);
 }
Пример #30
0
 /// Returnes a Floored point (copy)
 static public FloatPoint Floor(FloatPoint source)
 {
     return(new FloatPoint(Math.Floor(source.X), Math.Floor(source.Y)));
 }
Пример #31
0
 public static FloatPoint HitTestMinPoint(FloatPoint Center, float CircleRadius)
 {
     return Center - new FloatPoint(CircleRadius);
 }
Пример #32
0
 /// nearest int: digits
 static public FloatPoint Round(FloatPoint source, int digits)
 {
     return(new FloatPoint(Math.Round(source.X, digits), Math.Round(source.Y, digits)));
 }
Пример #33
0
 public static FloatPoint Centered(FloatPoint xp, double max_radius, double velocity)
 {
     float velo = (float)((velocity/1024D) * max_radius);
       return xp - (velo*.5D);
 }
Пример #34
0
 /// nearest int
 static public FloatPoint Round(FloatPoint source)
 {
     return(Round(source, 0));
 }
Пример #35
0
 public FloatRect(float x, float y, float width, float height)
 {
     Location = new FloatPoint(x, y); Size = new FloatPoint(width, height);
 }
Пример #36
0
        /// <summary>
        /// 水波紋效果
        /// </summary>
        /// <param name="src"></param>
        /// <param name="nWave">坡度</param>
        /// <returns></returns>
        public Bitmap AdjustRippleEffect(Bitmap src, short nWave)
        {
            int nWidth = src.Width;
            int nHeight = src.Height;

            // 透過公式進行水波紋的採樣

            FloatPoint[,] fp = new FloatPoint[nWidth, nHeight];

            Point[,] pt = new Point[nWidth, nHeight];

            Point mid = new Point();
            mid.X = nWidth / 2;
            mid.Y = nHeight / 2;

            double newX, newY;
            double xo, yo;

            //先取樣將水波紋座標跟RGB取出
            for (int x = 0; x < nWidth; ++x)
                for (int y = 0; y < nHeight; ++y)
                {
                    xo = (nWave * Math.Sin(2.0 * 3.1415 * y / 128.0));
                    yo = (nWave * Math.Cos(2.0 * 3.1415 * x / 128.0));

                    newX = (x + xo);
                    newY = (y + yo);

                    if (newX > 0 && newX < nWidth)
                    {
                        fp[x, y].X = newX;
                        pt[x, y].X = (int)newX;
                    }
                    else
                    {
                        fp[x, y].X = 0.0;
                        pt[x, y].X = 0;
                    }

                    if (newY > 0 && newY < nHeight)
                    {
                        fp[x, y].Y = newY;
                        pt[x, y].Y = (int)newY;
                    }
                    else
                    {
                        fp[x, y].Y = 0.0;
                        pt[x, y].Y = 0;
                    }
                }

            //進行合成
            Bitmap bSrc = (Bitmap)src.Clone();

            // 依照 Format24bppRgb 每三個表示一 Pixel 0: 藍 1: 綠 2: 紅
            BitmapData bitmapData = src.LockBits(new Rectangle(0, 0, src.Width, src.Height), ImageLockMode.ReadWrite,
                                           PixelFormat.Format24bppRgb);
            BitmapData bmSrc = bSrc.LockBits(new Rectangle(0, 0, bSrc.Width, bSrc.Height), ImageLockMode.ReadWrite,
                                             PixelFormat.Format24bppRgb);

            int scanline = bitmapData.Stride;

            IntPtr scan0 = bitmapData.Scan0;
            IntPtr srcScan0 = bmSrc.Scan0;

            unsafe
            {
                byte* p = (byte*)(void*)scan0;
                byte* pSrc = (byte*)(void*)srcScan0;

                int nOffset = bitmapData.Stride - src.Width * 3;

                int xOffset, yOffset;

                for (int y = 0; y < nHeight; ++y)
                {
                    for (int x = 0; x < nWidth; ++x)
                    {
                        xOffset = pt[x, y].X;
                        yOffset = pt[x, y].Y;

                        if (yOffset >= 0 && yOffset < nHeight && xOffset >= 0 && xOffset < nWidth)
                        {
                            p[0] = pSrc[(yOffset * scanline) + (xOffset * 3)];
                            p[1] = pSrc[(yOffset * scanline) + (xOffset * 3) + 1];
                            p[2] = pSrc[(yOffset * scanline) + (xOffset * 3) + 2];
                        }

                        p += 3;
                    }
                    p += nOffset;
                }
            }

            src.UnlockBits(bitmapData);
            bSrc.UnlockBits(bmSrc);

            return src;
        }
Пример #37
0
 public static void DoCircle(Graphics gfx, FloatPoint O, int M, int R)
 {
     DoCircle(gfx,SystemPens.ControlText,O,M,R);
 }
Пример #38
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     if (!IsMouseDown) {
     base.OnMouseMove(e);
     Invalidate(Needs.Mouse);
     return;
       }
       MouseTrail = (new FloatPoint(PointToClient(MousePosition))-MousePoint);
       base.OnMouseMove(e);
       Invalidate(Needs.Select|Needs.Mouse);
 }
Пример #39
0
 ///	static FromControl Methods (relative to the control)
 static public FloatRect FromControl(Control ctl, Padding pad)
 {
     return(new FloatRect(FloatPoint.GetPaddingTopLeft(pad), FloatPoint.GetClientSize(ctl) - FloatPoint.GetPaddingOffset(pad)));
 }
Пример #40
0
 ///	static FromControl Methods (relative to the control)
 public static FloatRect FromClientInfo(FloatPoint ClientSize, Padding pad)
 {
     return new FloatRect(FloatPoint.GetPaddingTopLeft(pad),ClientSize-FloatPoint.GetPaddingOffset(pad));
 }
Пример #41
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="x">Solving for y at x</param>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns></returns>
 public static float Process(int x, FloatPoint a, FloatPoint b)
 {
     return Process(x,a.X,a.Y,b.X,b.Y);
 }
Пример #42
0
 public FloatRect(float x, float y, float width, float height)
 {
     Location = new FloatPoint(x,y); Size = new FloatPoint(width,height);
 }
Пример #43
0
 public UPointD(FloatPoint value) : this((decimal)value.X, (decimal)value.Y)
 {
 }
Пример #44
0
 ///	static FromControl Methods (relative to the control)
 static public FloatRect FromClientInfo(FloatPoint ClientSize, Padding pad)
 {
     return(new FloatRect(FloatPoint.GetPaddingTopLeft(pad), ClientSize - FloatPoint.GetPaddingOffset(pad)));
 }
Пример #45
0
 public DoublePoint(FloatPoint value)
     : this(value.X,value.Y)
 {
 }
Пример #46
0
 /// <summary>same as FlattenPoint overload without boolean</summary>
 static public FloatPoint FlattenDown(FloatPoint _pin)
 {
     return(FlattenPoint(_pin));
 }
Пример #47
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     isMouseDown = true;
       Focused = true;
       MousePoint = PointToClient(MousePosition);
       base.OnMouseDown(e);
       Invalidate(Needs.Select|Needs.Mouse);
 }
Пример #48
0
 public DoublePoint(FloatPoint value) : this(value.X, value.Y)
 {
 }
Пример #49
0
 protected override void OnMouseUp(MouseEventArgs e)
 {
     //			MousePoint = MousePosition;
       isMouseDown = false;
       MouseTrail = new FloatPoint(0);
       base.OnMouseUp(e);
       Invalidate(Needs.Deselect|Needs.Mouse);
 }
Пример #50
0
        public static void DrawCirclePoints( Graphics gfx, Brush brush, float phase, FloatPoint box_dimension, FloatPoint size, int _count, float scale_by )
        {
            FloatPoint Offset = box_dimension * 0.5f;
              FloatPoint scale = FloatPoint.FlattenPoint(box_dimension,false);

              FloatRect render_rect = new FloatRect(Offset,size);

              for (float i=-_count;i<_count;i++)
              {
            FloatPoint Position = new FloatPoint(
              (float)(-Math.Sin(cvt(_count,i+phase))*((scale.X*scale_by)*0.5f)) ,
              (float)(Math.Cos(cvt(_count,i+phase))*((scale.Y*scale_by)*0.5f))
             );

            render_rect.Location = Offset+Position-(size*0.5f);
            gfx.FillEllipse(brush,render_rect);
              }
        }
Пример #51
0
 public bool Contains(FloatPoint point)
 {
     return point >= this.Location && point <= this.BottomRight;
 }
Пример #52
0
   public static void DrawCircles(
 Graphics gfx, Brush brush,
 float phase,
 FloatPoint box_dimension,
 FloatPoint size,
 int _count,
 float scale_by)
   {
       FloatPoint Offset = box_dimension * 0.5f;
         FloatPoint scale = FloatPoint.FlattenPoint(box_dimension,false);
         FloatRect render_rect = new FloatRect(Offset,size);
         FloatPoint[] points = CirclePoints(phase,box_dimension,size,_count);
         FloatPoint scaler = scale * (scale_by*0.5f);
         for (int i=0;i<points.Length;i++)
         {
       FloatPoint Position = CirclePoint(i,_count,phase);
       render_rect.Location = Offset+(Position*scaler)-(size*0.5f);
       gfx.FillEllipse(brush,render_rect);
         }
   }
Пример #53
0
 public FloatRect(FloatPoint L, FloatPoint S)
     : this(L.X,L.Y,S.X,S.Y)
 {
 }
Пример #54
0
 public static void ElipseToPath(System.Drawing.Drawing2D.GraphicsPath gp, FloatPoint xp, double radius)
 {
     FloatPoint rp = new FloatPoint(radius), hp = rp * 0.5f, dp = rp * 2.0f;
       FloatPoint p = xp-rp;
       gp.AddEllipse(p.X,p.Y,dp.X,dp.Y);
 }