Boxings.cs
(开头部分) 11KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using FangPage.Common;
namespace FangPage.Boxing
{
public class Boxing
{
static float move = 100f;//边框宽度
static float Max_X = 30000f;//X轴最大值
static float Max_Y_Left = 4000f;//左Y轴最大值
static float Max_Y_Right = 40f;//右Y轴最大值
static int XscaleCount = 15;//X轴刻度线数量
static int YscaleCount = 4;//Y轴刻度线数量
static string Y_Left_Title = "应力";//左Y轴名称
static string Y_Right_Title = "温度";//右Y轴名称
static string X_Title = "位置";//X轴名称
public byte[] DrawBoxing(int width, int height, List<FPObject> datas)
{
Bitmap image = new Bitmap(width, height);
Graphics gph = Graphics.FromImage(image);
//清空图片背景色
gph.Clear(Color.White);
try
{
//画图片的边框线
gph.DrawRectangle(new Pen(Color.Silver), 0, 0, image.Width - 1, image.Height - 1);
PointF cPt = new PointF(move, height / 2f);//中心点(坐标轴原点)
gph.DrawString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), new Font("宋体", 12, FontStyle.Bold), Brushes.Black, new PointF(width / 2f - 50, 12));//图表标题
DrawY_Left(gph, width, height, Max_Y_Left, YscaleCount);
DrawY_Right(gph, width, height, Max_Y_Right, YscaleCount);
DrawX_Bottom(gph, width, height, Max_X, XscaleCount);
DrawX_Top(gph, width, height, Max_X, XscaleCount);
gph.DrawLine(new Pen(Brushes.DarkGray, 2), cPt.X, cPt.Y, width - move, cPt.Y);//画出中轴线
float X_Between = (width - move * 2f) / Max_X;//水平间距像素
float Y_Left_Between = (image.Height / 2f - move) / Max_Y_Left; //左Y轴间距像素
后面还有 243 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
