C#如何显示网络URL地址来源的图片
|
admin
2017年3月8日 0:8
本文热度 5908
|
-
-
-
-
-
-
-
-
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
-
- namespace 网络图片
- {
- public partial class NetForm : Form
- {
- public NetForm()
- {
- InitializeComponent();
- }
-
-
-
-
-
- private void btnOpen_Click(object sender, EventArgs e)
- {
- try
- {
- this.picBox.Image = null;
- this.picBox.WaitOnLoad = false;
- this.picBox.SizeMode = PictureBoxSizeMode.StretchImage;
- this.picBox.LoadAsync("http://image.photophoto.cn/nm-7/003/028/0030280465.jpg");
- }
- catch
- {
- MessageBox.Show("网络链接失败!");
- }
-
- }
-
-
-
-
-
- private void picBox_LoadProgressChanged(object sender, ProgressChangedEventArgs e)
- {
- progBar.Value = e.ProgressPercentage;
- this.labProg.Text = e.ProgressPercentage.ToString() + "%";
- }
- }
- }
该文章在 2017/3/8 0:08:52 编辑过