Source/NFX.WinForms/Elements/ElementHostControl.cs
/// <summary>
/// Scrolls elements by delta x/y and destroys those elements that are completely out of the viewport.
/// </summary>
Scrolls elements by delta x/y and destroys those elements that are completely out of the viewport.
Scrolls elements by delta x / y and destroys those elements that are completely out of the viewport .
public void ScrollElementsBy(int offsetx, int offsety, int dx, int dy, bool destroy)    
      {
        using(var gr = this.CreateGraphics())
        {
          var origin = this.PointToScreen(new Point(offsetx, offsety));
          gr.SetClip(new Rectangle(offsetx, offsety, Width-offsetx, Height-offsety));
          gr.CopyFromScreen(origin, new Point(offsetx+dx, offsety+dy), new Size(Width - offsetx, Height-offsety), CopyPixelOperation.SourceCopy);
          foreach(var element in m_ElementList) 
            element.UpdateLocation(dx, dy);
          if (destroy)
          {
            var lst = GetElementsOutOfRegion(new Rectangle(0, 0, Width, Height)).ToList();
            foreach(var element in lst)
             element.Dispose();  
          }  
        }
      }
public void ScrollElementsBy ( int offsetx , int offsety , int dx , int dy , bool destroy ) { using ( var gr = this . CreateGraphics ( ) ) { var origin = this . PointToScreen ( new Point ( offsetx , offsety ) ) ; gr . SetClip ( new Rectangle ( offsetx , offsety , Width - offsetx , Height - offsety ) ) ; gr . CopyFromScreen ( origin , new Point ( offsetx + dx , offsety + dy ) , new Size ( Width - offsetx , Height - offsety ) , CopyPixelOperation . SourceCopy ) ; foreach ( var element in m_ElementList ) element . UpdateLocation ( dx , dy ) ; if ( destroy ) { var lst = GetElementsOutOfRegion ( new Rectangle ( 0 , 0 , Width , Height ) ) . ToList ( ) ; foreach ( var element in lst ) element . Dispose ( ) ; } } }
Scrolls elements by delta x/y and destroys those elements that are completely out of the viewport.
Scrolls elements by delta x / y and destroys those elements that are completely out of the viewport .
//todo dorabotat! //todo need to find elemnts that are partially out of region and invalidate them because their visibility partially changed //graphics
offsetx
int
offsety
int
dx
int
dy
int
destroy
bool