public void ReceiveMediaMessage(ChatDataModel.ChatMessage message) { var stream = GoogleDriveFilesRepository.DownloadFile(message.ImageMessageDriveID); var img = Image.FromStream(stream); var displayImage = ResizeImagePercentage(img); ChatMediaMessage mess = new ChatMediaMessage(displayImage, displayImage.Size, null, authorFriend, message.TimeSend); _rcChatlog.AddMessage(mess); }
public void ReceiveTextMessage(ChatDataModel.ChatMessage message) { if (!string.IsNullOrEmpty(message.ImageMessageDriveID)) { var stream = GoogleDriveFilesRepository.DownloadFile(message.ImageMessageDriveID); var img = Image.FromStream(stream); ChatMediaMessage mess = new ChatMediaMessage(img, new Size(128, 128), null, authorFriend, message.TimeSend); _rcChatlog.AddMessage(mess); return; } else { ChatTextMessage mess = new ChatTextMessage(message.Message, authorFriend, message.TimeSend); _rcChatlog.AddMessage(mess); } }