Source/Office2007Form/Office2007SystemCaptionItemPainter.cs
(开头部分) 17KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using DevComponents.DotNetBar.Rendering;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Windows.Forms;
namespace DevComponents.DotNetBar
{
/// <summary>
/// Represents the painter for the Office 2007 SystemCaptionItem
/// </summary>
internal class Office2007SystemCaptionItemPainter : SystemCaptionItemPainter, IOffice2007Painter
{
#region IOffice2007Painter
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
/// <summary>
/// Gets or sets color table used by renderer.
/// </summary>
public Office2007ColorTable ColorTable
{
get { return m_ColorTable; }
set { m_ColorTable = value; }
}
#endregion
#region Internal Implementation
/// <summary>
/// Paints the SystemCaptionItem as icon in left hand corner.
/// </summary>
/// <param name="e"></param>
public override void PaintSystemIcon(SystemCaptionItemRendererEventArgs e)
{
System.Drawing.Graphics g = e.Graphics;
SystemCaptionItem item = e.SystemCaptionItem;
Rectangle r = item.DisplayRectangle;
r.Offset((r.Width - 16) / 2, (r.Height - 16) / 2);
if (item.Icon != null)
{
if (System.Environment.Version.Build <= 3705 && System.Environment.Version.Revision == 288 && System.Environment.Version.Major == 1 && System.Environment.Version.Minor == 0)
{
IntPtr hdc = g.GetHdc();
try
{
NativeFunctions.DrawIconEx(hdc, r.X, r.Y, item.Icon.Handle, r.Width, r.Height, 0, IntPtr.Zero, 3);
}
finally
{
g.ReleaseHdc(hdc);
}
}
else
g.DrawIcon(item.Icon, r);
}
}
/// <summary>
后面还有 370 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。