X3

RedSky

导航

1 2 3 4 5 ··· 9 下一页

2024年8月13日 #

C# Sql帮助类,可扩展

摘要: 查看代码 [System.AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)] public class DbTableAttribute 阅读全文

posted @ 2024-08-13 15:33 HotSky 阅读(6) 评论(0) 推荐(0) 编辑

2024年8月5日 #

WPF WriteableBitmap通过GDI+绘制帮助类

摘要: 代码: public class WriteableBitmapGraphic : IDisposable { public WriteableBitmap Source { get; private set; } public System.Drawing.Bitmap bitmap { get; 阅读全文

posted @ 2024-08-05 18:14 HotSky 阅读(8) 评论(0) 推荐(0) 编辑

2024年8月3日 #

Alpha混合

摘要: 算法: 前景颜色值: R1,G1,B1,A1 背景颜色值: R2,G2,B2,A2 则混合后颜色值: R = R1 * A1 + R2 * A2 * (1-A1) G = G1 * A1 + G2 * A2 * (1-A1) B = B1 * A1 + B2 * A2 * (1-A1) A = 1 阅读全文

posted @ 2024-08-03 15:57 HotSky 阅读(1) 评论(0) 推荐(0) 编辑

2024年7月8日 #

Bmp读写二值图

摘要: public class Bmp : IDisposable { /* * 每行像素数据必须是4的倍数 * 黑白二值图0表示黑,1表示白 */ public int Width { get => _width; } public int Height { get => Math.Abs(_heigh 阅读全文

posted @ 2024-07-08 09:21 HotSky 阅读(2) 评论(0) 推荐(0) 编辑

2024年6月20日 #

WPF支持任意快捷键+鼠标组合的绑定类

摘要: WPF支持任意快捷键+鼠标组合的绑定类 public interface IInputSignal { bool IsMatch(InputEventArgs args); } public class KeyDownSignal : KeySignal { public KeyDownSignal(Key key) : base(key 阅读全文

posted @ 2024-06-20 16:34 HotSky 阅读(11) 评论(0) 推荐(0) 编辑

2024年6月11日 #

WPF阻止窗体被系统缩放,使用显示器DPI

摘要: WPF默认是跟随系统DPI变化(缩放与布局)而缩放窗体的; 微软把它称为默认DPI感知,当DPI发生变化时WPF感知到后缩放窗体,介绍链接:设置进程的默认 DPI 感知 (Windows) - Win32 apps | Microsoft Learn 如果我们不希望窗体被缩放,而是让窗体使用显示器D 阅读全文

posted @ 2024-06-11 15:32 HotSky 阅读(82) 评论(0) 推荐(0) 编辑

2024年6月3日 #

WPF DataGrid自动增长序号列

摘要: /// <summary> /// 自动增长序号列 /// </summary> public class DataGridRowIndexColumn : DataGridTextColumn { /// <summary> /// 可以指定开始序号 /// </summary> public i 阅读全文

posted @ 2024-06-03 16:09 HotSky 阅读(15) 评论(0) 推荐(0) 编辑

2024年5月27日 #

C#访问或修改私有类、函数、变量、属性

摘要: public static class TypeUtil { public static Type? GetType(string assemblyName, string typePath) { var assembly = Assembly.Load(assemblyName); if (ass 阅读全文

posted @ 2024-05-27 10:57 HotSky 阅读(45) 评论(1) 推荐(0) 编辑

2024年5月25日 #

WPF一个简单的属性编辑控件

摘要: 代码: public class PropertiesControl : Grid { [TypeConverter(typeof(LengthConverter))] public double RowHeight { get { return (double)GetValue(RowHeight 阅读全文

posted @ 2024-05-25 18:00 HotSky 阅读(7) 评论(0) 推荐(0) 编辑

2024年2月20日 #

C#Sqlite插入/更新并返回数据

摘要: 关键词:returning 返回所有列:returning *; 返回指定列:returning columnname; 删除命令不支持returning 参考代码: string path = @"Data Source=D:\Data\data.sqlite;Version=3"; using 阅读全文

posted @ 2024-02-20 15:32 HotSky 阅读(125) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 9 下一页