Exemple #1
0
        /// <summary>
        /// Decode the encoded data to surface
        /// </summary>
        /// <param name="tileDic">The dictionary of tile index and encoded tile data</param>
        public void ProgressiveDecode(Dictionary <TileIndex, EncodedTile> tileDic)
        {
            if (this.CurrentFrame == null)
            {
                this.CurrentFrame = SurfaceFrame.GetFromImage(this.Id, new Bitmap(this.Width, this.Height));
            }

            foreach (TileIndex index in tileDic.Keys)
            {
                TileState tState = new TileState(this, index);
                RfxProgressiveDecoder.DecodeTile(tileDic[index], tState);
            }
        }
Exemple #2
0
 /// <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);
 }
Exemple #3
0
 /// <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();
 }