Source/UIGraphics.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;

namespace DevComponents.DotNetBar
{
	/// <summary>
	/// Represents class that holds User Interface static methods.
	/// </summary>
	internal class UIGraphics
	{
		private UIGraphics()
		{
		}

		/// <summary>
		/// Gets the graphics path that represents triangle.
		/// </summary>
		/// <param name="p">Top left position of the triangle.</param>
		/// <param name="size">Size of the triangle.</param>
		/// <param name="direction">Pointing direction of the triangle.</param>
		/// <returns>Returns graphics path for the triangle of given size and pointing in given direction.</returns>
		public static GraphicsPath GetTrianglePath(Point p, int size, eTriangleDirection direction)
		{
			GraphicsPath path=new GraphicsPath();
			switch(direction)
			{
				case eTriangleDirection.Left:
				{
					p.X--;
					path.AddLine(p.X+size/2,p.Y,p.X+size/2,p.Y+size);
					path.AddLine(p.X,p.Y+size/2,p.X+size/2,p.Y);
					path.CloseAllFigures();
					break;
				}
				case eTriangleDirection.Right:
				{
					path.AddLine(p.X,p.Y,p.X,p.Y+size);
					path.AddLine(p.X+size/2,p.Y+size/2,p.X,p.Y);
					path.CloseAllFigures();
					break;
				}
				case eTriangleDirection.Top:
				{
					path.AddLine(p.X,p.Y+size/2,p.X+size,p.Y+size/2);
					path.AddLine(p.X+size/2,p.Y,p.X,p.Y+size/2);
					path.CloseAllFigures();
					break;
				}
				case eTriangleDirection.Bottom:
				{
					path.AddLine(p.X,p.Y,p.X+size,p.Y);
					path.AddLine(p.X+size/2,p.Y+size/2,p.X,p.Y);
					path.CloseAllFigures();
					break;
				}
			}

			return path;
后面还有 112 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。