【发布时间】:2017-04-09 07:19:36
【问题描述】:
我正在尝试在 listview 处于活动状态并包含项目时更改 imagelist 图像大小。但是好像只影响新添加的图片,现有的图片会变成空白。
这是我的代码:
public Form1()
{
...
imglst_ = new ImageList();
imglst_.ImageSize = new Size(80, 80);
listView1.SmallImageList = imglst_;
listView1.LargeImageList = imglst_;
...
}
//zoom in
//This code only affect the new added image
//the existing images will become blank
private void toolStripZoomin_Click(object sender, EventArgs e)
{
int w = imglst_.ImageSize.Width;
int h = imglst_.ImageSize.Height;
w = (int)(w * 1.2);
h = (int)(h * 1.2);
imglst_.ImageSize = new Size(w, h);
}
【问题讨论】:
标签: c#