我一直在玩自定义调色板,看看什么会与我的下一个头发纹理的想法。当我将winform用户控件添加到调色板时,一切看起来都像预期的那样,当添加wpf用户控件时,背景是全黑的。按钮或我添加的任何东西看起来都很好,只是背景。下面是我正在使用的代码:
- using Autodesk.AutoCAD.Runtime;
- using Autodesk.AutoCAD.Windows;
- [assembly:CommandClass(typeof(Tims_CSharp.CustomPalette))]
- namespace Tims_CSharp
- {
- class CustomPalette
- {
- public PaletteSet myPaletteSet;
- public PaletteControl controlPalette;
- public wpfPalControl wpfPalette;
- [CommandMethod("palSet")]
- public void SamplePalette()
- {
- if (myPaletteSet == null)
- {
- myPaletteSet = new PaletteSet("MyPalette", new System.Guid("ABF3806E-DA13-4827-80FB-29D3F10952BE"));
- controlPalette = new PaletteControl();
- wpfPalette = new wpfPalControl();
- myPaletteSet.Add("Custom Palette", controlPalette);
- myPaletteSet.AddVisual("WPF Palette", wpfPalette);
- }
- myPaletteSet.Visible = true;
-
- }
- }
- }
我正在使用vs2010和AutoCAD 2012。
知道为什么会这样吗?再次感谢,
蒂姆
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |