WindowsFormsApp/FrmDrawPanel.cs
(开头部分) 18KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using log4net;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApp
{
public partial class FrmDrawPanel : Form
{
/// <summary>
/// 日志对象
/// </summary>
private static readonly ILog _log = log4net.LogManager.GetLogger("logSysApp");
/// <summary>
/// 图像文件
/// </summary>
//private string filePath = @"D:\\Images\\000141884_K722_D3008_2_29.jpg";
private string rootPath = Application.StartupPath;
private string filePath = Application.StartupPath + @"\pic\ss.jpg";
/// <summary>
/// 构造函数
/// </summary>
public FrmDrawPanel()
{
InitializeComponent();
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
this.UpdateStyles();
// 绑定鼠标滚珠事件
panelDraw.MouseWheel += PanelDraw_MouseWheel;
// 对当前窗体启用双缓冲
this.DoubleBuffered = true;
// 初始化图像数据
_ImageSrc = Image.FromFile(filePath);
}
/// <summary>
/// 初始化完成后执行绘制
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void FrmDrawPanel_Load(object sender, EventArgs e)
{
// 根据窗口大小设置放缩比
SetZoom(this.panelDraw.Size);
// 执行绘制操作
this.DrawImage();
}
/// <summary>
/// 最小缩放比
/// </summary>
private const float ZOOM_MIN = 0.05F;
/// <summary>
后面还有 464 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
