I'm having a problem with the image quality of the image that is displayed on the TabPage header. My source image is a 16x16 png with transparency. When I load it into the TabPage header, the quality is horrible. So far, the best I've been able to come up with is to use an 8 bit png instead of a 32 bit png. This helps significantly, but the quality is still not as good as I would like, and still not as good as a 32 bit png. Does anyone have a good method of preserving the png quality?
(32 bit original on left. 32 bit tab header lower quality on right.)
(8 bit original on left. 8 bit tab header lower quality on right.)
(32 bit original on left. 8 bit tab header lower quality on right.)
I'm trying/hoping to get it as close as possible to looking like the original 32 bit png.
I'm using the below code:
public class Form1
public void Form1()
// initialize the imagelist
ImageList imageList1 = new ImageList();
//initialize the tab control
TabControl tabControl1 = new TabControl();
tabControl1.Dock = DockStyle.Fill;
tabControl1.ImageList = imageList1;
tabControl1.TabPages.Add("tabKey1", "TabText1", "key1");
tabControl1.TabPages.Add("tabKey2", "TabText2", "key2");
Not sure if this answers your question, but have to post it as answer to include the snapshot.
You might try below:
Or simply change it in code:
imageList1.ColorDepth = ColorDepth.Depth32Bit;