我正在尝试将带有文本的任务栏图标覆盖添加到 windows7 应用程序图标,我确实设法添加了小覆盖,但无法添加文本。
有谁知道如何添加动态文本作为任务栏图标叠加层?
使用:WPF 和 C#
您只能添加一个Image
所以你必须创建:
RectangleF rectF = new RectangleF(0, 0, 40, 40);
Bitmap bitmap = new Bitmap(40, 40, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Graphics g = Graphics.FromImage(bitmap);
g.FillRectangle(System.Drawing.Brushes.White, 0, 0, 40, 40);
g.DrawString("5", new Font("Arial", 25), System.Drawing.Brushes.Black, new PointF(0, 0));
IntPtr hBitmap = bitmap.GetHbitmap();
ImageSource wpfBitmap =
Imaging.CreateBitmapSourceFromHBitmap(
hBitmap, IntPtr.Zero, Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
TaskbarItemInfo.Overlay = wpfBitmap;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)