【发布时间】:2015-06-29 07:54:37
【问题描述】:
我想使用ImageList 使用计时器循环显示图像。它工作正常,只是在PictureBox 上生动地显示的同一图像在应该显示图像列表中的图片时失去其质量。
直接在PictureBox中显示时的图像:
显示在PictureBox 中但通过ImageList (pictureBox1.Image = imglist.Images[0];) 显示的图像:
我的图片是128x128 png,这是我的PictureBox 和ImageList 的设计器代码:
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(378, 78);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(128, 128);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
//
// imglist
//
this.imglist.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglist.ImageStream")));
this.imglist.TransparentColor = System.Drawing.Color.Transparent;
this.imglist.Images.SetKeyName(0, "1423093311_supportfemale-48.png");
【问题讨论】:
-
你试过
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;吗? -
@Hughnited 是的,但我得到了相同的结果。
-
看图片,好像不是质量下降,而是imageList在加边框……
-
@DominikB 是真的。但是为什么会出现呢?
-
她的一个类似问题的链接:stackoverflow.com/questions/10372797/…
标签: c# image winforms picturebox imagelist