LunarPresentation/Expressions/PictureBox.cs
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Xml;
using Microsoft.Win32;
using SHomeWorkshop.LunarPresentation.Interfaces;
using SHomeWorkshop.LunarPresentation.Widegets;
namespace SHomeWorkshop.LunarPresentation.Expressions
{
public class PictureBox : Expression, ICollapsed
{
public PictureBox(SubPanel rootPanel, SubPanel parentPanel, Editor editor)
: base(rootPanel, parentPanel, editor)
{
img = new Image();
img.SnapsToDevicePixels = true;
img.Cursor = System.Windows.Input.Cursors.Hand;
img.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(img_MouseRightButtonDown);
img.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(img_PreviewMouseLeftButtonDown);
img.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(img_MouseLeftButtonDown);
img.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(img_MouseLeftButtonUp);
img.Source = PictureBox.defaultBitmap;
RenderOptions.SetBitmapScalingMode(img, BitmapScalingMode.NearestNeighbor);
this.mainBorder.Child = img;
this.chineseName = "图片框";
}
static PictureBox()
{
defaultBitmap = new BitmapImage(new Uri("pack://application:,,,/LunarPresentation;component/Resources/Icons/Question.png"));
}
public static System.Windows.Media.Imaging.BitmapImage defaultBitmap;
void img_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// 接收拖动来的公式。
Globals.DropExpression(this);
}
void img_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (e.ClickCount == 2)
{
LoadImageFromFile();
e.Handled = true;
}
}
void img_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (Editor == null) return;
后面还有 296 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。