使用UF函數能直接設置UG背景顏色:
1.設置背景顏色選項為純色:
2.編寫更新背景顏色代碼:
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.效果: