Exemplo n.º 1
0
        private void BtnPreview_Click(object sender, EventArgs e)
        {
            var response = WebRequestUtil.GetAdsImg(this.comboBox1.SelectedIndex + 1);

            if (response != null)
            {
                var data = JsonUtil.Deserialize <QSWResponse <string> >(response.Content);
                if (!string.IsNullOrEmpty(data.Data))
                {
                    var    imgBytes  = Convert.FromBase64String(data.Data);
                    string imageFile = SaveToCache(imgBytes);
                    this.pictureBox1.Image = new Bitmap(imageFile);
                }
            }
        }