【发布时间】:2011-07-24 05:50:27
【问题描述】:
在这里我想像这样设置图像位置:
pic1.ImageLocation = "";
pic2.ImageLocation = "";
等等……
foreach (ImageResult result in response.Image.Results)
{
i++;
PictureBox thumnailBox = new System.Windows.Forms.PictureBox();
thumnailBox.Name = "pic" + i.ToString();
//HOW TO DO ??
//thumnailBox.ImageLocation = result.Thumbnail.Url;
//listView1.Items.Add(thumnailBox.Name);
}
【问题讨论】:
-
有什么问题?为什么
thumnailBox.ImageLocation = result.Thumbnail.Url;不适合你? -
嗨 Cody Gray,我想通过其图片框 ID 设置 ImageLocation 属性,例如 pic1.ImageLocation = "rose.jpg"; pic2.ImageLocation = "lily.jpg";
-
图片不显示?你看到错误了吗?您是否调试了代码并查看了 response.Image.Results 的值?它们是图像的有效 URL 吗?你的问题太模糊了,@jack。
-
@Wesley 我有 10 张不同的图像,并且显示了图像,但只显示了 1 张图像。我运行 foreach 循环以获取所有图像并设置图像位置路径“thumnailBox.ImageLocation = result.Thumnail.Url”并将此 thumnailBox 控件添加到 listview1.Controls.Add(thumbnail);但这仅向我展示了 1 张图片。我想在列表视图中显示所有图片。我希望你能理解我的问题
标签: c# .net winforms controls picturebox