C# NX二次开发-设置背景颜色

使用UF函数能直接设置UG背景颜色:

1.设置背景颜色选项为纯色:

2.编写更新背景颜色代码:

cs 复制代码
      var nxColor = NXColor.Factory._Get(186);
      var rgb = nxColor.GetRgb();
      double[] arr = [rgb.R, rgb.G, rgb.B];
      theUf.Disp.SetColor(UFConstants.UF_DISP_BACKGROUND_COLOR, UFConstants.UF_DISP_rgb_model, null, arr);
      theUf.Disp.LoadColorTable();

3.效果:

相关推荐
用户37215742613513 小时前
C# 提取 PDF 附件:包括文档附件和页面注释附件
c#
寂寞的船14 小时前
【Unity Bug挑战】第12期 Awaitable 二次 await 死锁之谜 —— 为什么同一个异步操作等两次就卡死?
unity·c#·游戏引擎·bug
Jeff-Tsai1 天前
Day 18:错误契约与用户可见消息
.net·架构设计·erp·definition-driven
IT规划师1 天前
HybridCache-缓存架构决策框架落地
架构·.net
Jeff-Tsai2 天前
Day 17:Connector 与调用端的职责收敛
.net·架构设计·erp·definition-driven
huaqianzkh2 天前
WinForm C#:循环修改控件UI闪烁卡顿?SuspendLayout / ResumeLayout 与 BeginUpdate 优化
开发语言·ui·c#
用户3721574261353 天前
C# 实现 Excel 单元格保护:锁定公式并允许编辑指定区域
c#·ai编程·编程语言
IT规划师3 天前
NET10 高并发架构契约与落地实现
架构·.net
公子小六3 天前
基于.NET的Windows窗体编程之WinForms数据持久化(1)
windows·microsoft·c#·.net·winforms
三雷科技3 天前
第6章第4节:自定义分词器
开发语言·c#