Image losing quality when displayed with imagelist

I would like to use ImageList

to display images in a loop using a timer. It works great, except that the same image that is displayed brightly on PictureBox

loses its quality when the same PictureBox

image is supposed to display an image from the image list.

Image shown directly in PictureBox

:

enter image description here

Image if shown in PictureBox

but via ImageList

( pictureBox1.Image = imglist.Images[0];

):

enter image description here

My image is a 128x128

png and here is the constructor code for mine PictureBox

and 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");

      

enter image description here

+3


source to share





All Articles