Flash CS5 用户自定义Button组件二-livepreview的设定

  2011/1/7 Flash CS5 用户自定义Button组件-livepreview的设定
  1.经过长久的百次的实验,把button,labelButton baseButton,UIComponent等Adobe类都仔细研究了一遍,毫无进展,因为这些采用非动态设置skin的,最后还是研究项目的FrameWork的LabelButton和BaseComponent类,发现如果在designe的时候,看到skin显示,就必须使用skin的绝对路径,在运行后绝对和相对就都可以使用了。
  不是这样:[Inspectable(defaultValue="Design/Skin/Btn_Common. swf")]
  而是这样:[Inspectable(defaultValue="D:/JavaDevSpace/WorkSpa ce/FlashToFlash/Design/Skin/Btn_Common.swf")]
  有待完成,D:/JavaDevSpace/WorkSpace/FlashToFlash/的取得准备放到BaseComponent类中取得,Button类就直接设置成[Inspectable(defaultValue="Design/Skin/Btn_Common. swf")],然后concat。
  2.components 定义对话框中的livepreview设置就是该组件的swf文件就可以了。
  3.父类要实现draw类。采用draw类call updateComponent方法。子组件就直接继承updateComponent方法即可。所有更新放到updateComponent方法里面。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在WPF应用程序中设置标题栏颜色,你可以使用以下代码: 1. 首先,添加以下命名空间: ```csharp using System.Windows.Interop; using System.Runtime.InteropServices; ``` 2. 接着,在你的窗口类中添加以下方法: ```csharp private void SetWindowTitleBarColor(Color color) { var hwnd = new WindowInteropHelper(this).Handle; var accent = new AccentPolicy(); accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND; accent.AccentFlags = 0x20 | 0x40 | 0x80 | 0x100; accent.GradientColor = (color.R << 16) | (color.G << 8) | color.B; var accentStructSize = Marshal.SizeOf(accent); var accentPtr = Marshal.AllocHGlobal(accentStructSize); Marshal.StructureToPtr(accent, accentPtr, false); var data = new WindowCompositionAttributeData(); data.Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY; data.SizeOfData = accentStructSize; data.Data = accentPtr; SetWindowCompositionAttribute(hwnd, ref data); Marshal.FreeHGlobal(accentPtr); } [DllImport("user32.dll")] internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); [StructLayout(LayoutKind.Sequential)] public struct AccentPolicy { public AccentState AccentState; public int AccentFlags; public int GradientColor; public int AnimationId; } public enum AccentState { ACCENT_DISABLED = 0, ACCENT_ENABLE_GRADIENT = 1, ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, ACCENT_ENABLE_BLURBEHIND = 3, ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, ACCENT_INVALID_STATE = 5 } public enum WindowCompositionAttribute { WCA_UNDEFINED = 0, WCA_NCRENDERING_ENABLED = 1, WCA_NCRENDERING_POLICY = 2, WCA_TRANSITIONS_FORCEDISABLED = 3, WCA_ALLOW_NCPAINT = 4, WCA_CAPTION_BUTTON_BOUNDS = 5, WCA_NONCLIENT_RTL_LAYOUT = 6, WCA_FORCE_ICONIC_REPRESENTATION = 7, WCA_EXTENDED_FRAME_BOUNDS = 8, WCA_HAS_ICONIC_BITMAP = 9, WCA_THEME_ATTRIBUTES = 10, WCA_NCRENDERING_EXILED = 11, WCA_NCADORNMENTINFO = 12, WCA_EXCLUDED_FROM_LIVEPREVIEW = 13, WCA_VIDEO_OVERLAY_ACTIVE = 14, WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15, WCA_DISALLOW_PEEK = 16, WCA_CLOAK = 17, WCA_CLOAKED = 18, WCA_ACCENT_POLICY = 19, WCA_FREEZE_REPRESENTATION = 20, WCA_EVER_UNCLOAKED = 21, WCA_VISUAL_OWNER = 22, WCA_LAST = 23 } [StructLayout(LayoutKind.Sequential)] public struct WindowCompositionAttributeData { public WindowCompositionAttribute Attribute; public IntPtr Data; public int SizeOfData; } ``` 3. 最后,在窗口的构造函数中调用 `SetWindowTitleBarColor` 方法,并传递一个 `Color` 类型的参数,如下所示: ```csharp public MainWindow() { InitializeComponent(); SetWindowTitleBarColor(Colors.Blue); } ``` 这将设置标题栏的颜色为蓝色。你可以使用任何有效的 `Color` 对象来设置颜色。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值