/// <summary>
 /// Update surface from the changed area of the bitmap frame
 /// </summary>
 /// <param name="bmp">Bitmap which used to update surface</param>
 /// <param name="changedArea">The changed areas</param>
 public void UpdateFromBitmap(Bitmap bmp, Rectangle[] changedAreas)
 {
     if (pendingUpdateIndexs != null && LastFrame !=null)
     {
         foreach (TileIndex index in pendingUpdateIndexs)
         {
             LastFrame.UpdateTileRgb(index, CurrentFrame.GetRgbTile(index));
         }
     }
     else
     {
         LastFrame = CurrentFrame;
     }
     pendingUpdateIndexs = this.GetIndexesInRect(changedAreas);
     CurrentFrame = SurfaceFrame.GetFromImage(Id, bmp, pendingUpdateIndexs);
 }
 /// <summary>
 /// Update surface to new bitmap
 /// </summary>
 /// <param name="bmp">Bitmap which used to update surface</param>
 public void UpdateFromBitmap(Bitmap bmp)
 {
     if (pendingUpdateIndexs != null && LastFrame != null)
     {
         foreach (TileIndex index in pendingUpdateIndexs)
         {
             LastFrame.UpdateTileRgb(index, CurrentFrame.GetRgbTile(index));
         }
     }
     else
     {
         LastFrame = CurrentFrame;
     }
     CurrentFrame = SurfaceFrame.GetFromImage(Id, bmp);
     pendingUpdateIndexs = CurrentFrame.GetAllIndexes();
 }