图像收集属性
i介绍了更新的材料k.2软件包的源代码,这是相关部分。
if (_tabLabel != TabLabelStyle.Text)
{
// Icons
if (_baseTabControl.ImageList != null && (!String.IsNullOrEmpty(tabPage.ImageKey) | tabPage.ImageIndex > -1))
{
Rectangle iconRect = new Rectangle(
_tabRects[currentTabIndex].X + (_tabRects[currentTabIndex].Width / 2) - (ICON_SIZE / 2),
_tabRects[currentTabIndex].Y + (_tabRects[currentTabIndex].Height / 2) - (ICON_SIZE / 2),
ICON_SIZE, ICON_SIZE);
if (_tabLabel == TabLabelStyle.IconAndText)
{
iconRect.Y = 12;
}
// Begin TabSelector modifications, Store previous settings to restore after drawing.
var oldSmoothingMode = g.SmoothingMode;
var oldCompositingMode = g.CompositingQuality;
var oldPixelOffsetMode = g.PixelOffsetMode;
var oldInterpolationMode = g.InterpolationMode;
try
{
// Modified graphic draw modes here
g.SmoothingMode = SmoothingMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
// Draw the image in the iconRect
g.DrawImage(
!String.IsNullOrEmpty(tabPage.ImageKey)
? _baseTabControl.ImageList.Images[tabPage.ImageKey]
: _baseTabControl.ImageList.Images[tabPage.ImageIndex],
iconRect
);
}
finally
{
// End modifications, Restore original modes after drawing
g.SmoothingMode = oldSmoothingMode;
g.CompositingQuality = oldCompositingMode;
g.PixelOffsetMode = oldPixelOffsetMode;
g.InterpolationMode = oldInterpolationMode;
}
}
}
I试图强迫Tabselector控制以更高的质量绘制图像。结果相同。 我错过了什么?任何帮助将不胜感激! I修改了材料。2TabSelector图形属性试图提高图像质量。
具有某些控件上的应用程序不喜欢PNG格式图像。将图像导入图像列表时,请使用PNG以外的图像格式。 ICO文件保留透明度,没有任何压缩/抽签问题。