private void UpdateImage(CloudBlockBlob imageBlob, Emotion[] emotions, Face[] faces) { var image = this.LoadImage(imageBlob.Uri.AbsoluteUri); int i = 0; foreach (var emotion in emotions) { var maxEmotion = emotionProvider.GetMaxEmotion(emotion); var rectangle = new Rectangle( emotion.FaceRectangle.Left, emotion.FaceRectangle.Top, emotion.FaceRectangle.Width, emotion.FaceRectangle.Height); reactor.Decorate(image, rectangle, maxEmotion.EmotionName); tableStorageProvider.SaveData(maxEmotion, faces[i], imageBlob.Uri.AbsoluteUri); i++; } SaveImage(imageBlob, image); }