WpfApp1/MainWindow.xaml.cs

(开头部分) 7KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WpfWorld;

namespace WpfApp1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            Loaded += MainWindow_Loaded;
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            double r = Math.Min(this.ActualHeight, this.ActualWidth) / 2;
            Paint(r - 60, r - 10, 6, true);
        }

        /// <summary>
        /// 半径溢出10像素
        /// </summary>
        /// <param name="inRadius">内圆半径</param>
        /// <param name="outRadius">外圆半径</param>
        /// <param name="count">数量</param>
        /// <param name="AutoRotate">内容是否随圆形旋转</param>
        void Paint(double inRadius, double outRadius, int count, bool AutoRotate)
        {
            //Path p = this.red1;
            double overflow = 20;  //偏移量
            double iDiameter = inRadius * 2;
            double oDiameter = outRadius * 2;
            double iWidth = outRadius - inRadius;
            Vector iPoint = new Vector(iWidth, iWidth);
            List<Point> inPoints = GetPoints(inRadius, count, overflow / 2);
            List<Point> outPoints = GetPoints(outRadius, count, overflow / 2);

            double transformY = (outRadius - inRadius) / 2 + inRadius; //内容在Y轴偏移量
            double angleUnit = 360 / count; //单位角度,每份占用角度

            //绘制圆弧
            for (int i = 0; i < count; i++)
            {
后面还有 121 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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