Source/Display.cs
(完整代码) 1KBusing System.Drawing;
using System.Drawing.Drawing2D;
#if TREEGX
namespace DevComponents.Tree
#elif DOTNETBAR
namespace DevComponents.DotNetBar
#endif
{
/// <summary>
/// Summary description for Display.
/// </summary>
internal class Display
{
private Display()
{
}
public static LinearGradientBrush CreateLinearGradientBrush(Rectangle r,Color color1, Color color2,float gradientAngle)
{
if(r.Width<=0)
r.Width=1;
if(r.Height<=0)
r.Height=1;
return new LinearGradientBrush(new Rectangle(r.X,r.Y-1,r.Width,r.Height+1),color1,color2,gradientAngle);
}
public static LinearGradientBrush CreateLinearGradientBrush(RectangleF r,Color color1, Color color2,float gradientAngle)
{
if(r.Width<=0)
r.Width=1;
if(r.Height<=0)
r.Height=1;
return new LinearGradientBrush(new RectangleF(r.X,r.Y-1,r.Width,r.Height+1),color1,color2,gradientAngle);
}
public static LinearGradientBrush CreateLinearGradientBrush(Rectangle r,Color color1, Color color2,float gradientAngle, bool isAngleScalable)
{
if(r.Width<=0)
r.Width=1;
if(r.Height<=0)
r.Height=1;
return new LinearGradientBrush(new Rectangle(r.X,r.Y-1,r.Width,r.Height+1),color1,color2,gradientAngle,isAngleScalable);
}
public static Rectangle GetDrawRectangle(Rectangle r)
{
r.Width--;
r.Height--;
return r;
}
public static Rectangle GetPathRectangle(Rectangle r)
{
//r.Width++;
//r.Height++;
return r;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。