win7的毛玻璃真是挡字幕神器,win8的就呵呵了[s:30]
[修改于 10年3个月前 - 2015/06/18 08:13:31]
引用 20!不曾存在:这个我以前也做过,不过没做过点不到的。。。不过也很好做的。。。但是点不到你准备怎么移动它?[s::lol]
能置顶一个点不到的png半透明图片就好了
引用 acmilan:留个边框可以移动啊,屏幕录像都是这样做的。
这个我以前也做过,不过没做过点不到的。。。不过也很好做的。。。但是点不到你准备怎么移动它?
我用这个程序实现了一个鼠标点不到功能。。。但是使用起来要注册系统快捷键,有点麻烦
引用 20!不曾存在:屏幕录像好像也要快捷键的吧,不然怎么获得焦点。。。留个边框可移动和鼠标点得到有什么区别。。。
留个边框可以移动啊,屏幕录像都是这样做的。
图片能够自定义(特别是gif),这样可以录像的时候可以更方便的遮挡和加水印,临摹的时候也有用
引用 20!不曾存在:Win32要想做临摹拓版这种半透明局部穿透有点麻烦。
留个边框可以移动啊,屏幕录像都是这样做的。
图片能够自定义(特别是gif),这样可以录像的时候可以更方便的遮挡和加水印,临摹的时候也有用
引用 20!不曾存在:就像这样?
留个边框可以移动啊,屏幕录像都是这样做的。
图片能够自定义(特别是gif),这样可以录像的时候可以更方便的遮挡和加水印,临摹的时候也有用
引用 acmilan:nice, 就是你的测试图片不要那么惊悚
就像这样?
引用 20!不曾存在:快编完了,先给你一个exe,源代码有空再上传
nice, 就是你的测试图片不要那么惊悚
引用 acmilan:谢
快编完了,先给你一个exe,源代码有空再上传
引用 acmilan:win8可以用WPF 可以设置透明度 也能挡住
win7的毛玻璃真是挡字幕神器,win8的就呵呵了
引用 张静茹:WPF中的高斯模糊应该和DirectUI差不多,我没试过,兼容性应该比这个更好。我这个是直接把标题栏拉到客户区了,win8下就成色块了。
win8可以用WPF 可以设置透明度 也能挡住
引用 acmilan:
WPF中的高斯模糊应该和DirectUI差不多,我没试过,兼容性应该比这个更好。我这个是直接把标题栏拉到客户区了,win8下就成色块了。
引用 张静茹:你这是半透明嘛。。。半透明挡住跟没挡一个样,win8下玩虚拟机时我就用过半透明任务栏看序列号
写了半天,还真没那么简单,如果窗体设置为支持透明,窗口样式就必须设置为None,就是没有标题栏 也没用最大最小花按钮,也没法缩放,去抄了几段代码 总算可以用了
引用 acmilan:
你这是半透明嘛。。。半透明挡住跟没挡一个样,win8下玩虚拟机时我就用过半透明任务栏看序列号
MFC、Win32中实现半透明也很简单。。。首先把窗口的WS_EX_LAYERED特性选上,然后SetLayeredWindowAttribut...
Otherusing System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Drawing;
namespace Aero
{
internal enum AccentState
{
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3,
ACCENT_INVALID_STATE = 4
}
[StructLayout(LayoutKind.Sequential)]
internal struct AccentPolicy
{
public AccentState AccentState;
public int AccentFlags;
public int GradientColor;
public int AnimationId;
}
[StructLayout(LayoutKind.Sequential)]
internal struct WindowCompositionAttributeData
{
public WindowCompositionAttribute Attribute;
public IntPtr Data;
public int SizeOfData;
}
internal enum WindowCompositionAttribute
{
// ...
WCA_ACCENT_POLICY = 19
// ...
}
class Win10Style
{
[DllImport("dwmapi.dll")]
public static extern void DwmIsCompositionEnabled(ref int enabledptr);
[DllImport("dwmapi.dll")]
public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS margin);
[DllImport("User32.dll")]
public static extern IntPtr GetSystemMenu(IntPtr hWnd, [MarshalAs(UnmanagedType.Bool)]bool bRevert);
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern long TrackPopupMenuEx(IntPtr hMenu, uint un, uint n1, uint n2, IntPtr hWnd, IntPtr lpTPMParams);
[DllImport("user32.dll", EntryPoint = "PostMessage", CallingConvention = CallingConvention.Winapi)]
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern long GetCursorPos(ref Point lpPoint);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
[DllImport("user32.dll")]
public static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
public struct MARGINS
{
public int m_Left;
public int m_Right;
public int m_Top;
public int m_Buttom;
};
//Win10专用
public static void EnableBlur(IntPtr HWnd)
{
var accent = new AccentPolicy();
accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND;
accent.GradientColor = 0xFF0000;
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);
}
//Vista之后通用
public static void EnableAero(Form target)
{
MARGINS mg = new MARGINS();
mg.m_Buttom = -1;
mg.m_Left = -1;
mg.m_Right = -1;
mg.m_Top = -1;
DwmExtendFrameIntoClientArea(target.Handle, ref mg);
Color aeroColor = Color.FromArgb(164, 212, 211);
target.BackColor = aeroColor;
target.TransparencyKey = aeroColor;
}
public static void DragWindow(IntPtr hwnd)
{
ReleaseCapture();
SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
}
public static void ShowSystemMenu(IntPtr hwnd)
{
const uint TPM_RETURNCMD = 0x0100;
const uint TPM_LEFTBUTTON = 0x0;
if (hwnd == IntPtr.Zero)
{
return;
}
Point defPnt = new Point();
GetCursorPos(ref defPnt);
IntPtr hmenu = GetSystemMenu(hwnd, false);
long cmd = TrackPopupMenuEx(hmenu, TPM_LEFTBUTTON | TPM_RETURNCMD,
(uint)defPnt.X, (uint)defPnt.Y,
hwnd, IntPtr.Zero);
if (0 != cmd)
{
PostMessage(hwnd, WM_SYSCOMMAND, new IntPtr(cmd), IntPtr.Zero);
}
}
}
}
TypeScriptprivate void Form1_Load(object sender, EventArgs e)
{
Aero.Win10Style.EnableBlur(this.Handle);
Aero.Win10Style.EnableAero(this);
}
private void panelExtended_MouseDown(object sender, MouseEventArgs e)
{
Aero.Win10Style.DragWindow(this.Handle);
}
private void panelExtended_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
Aero.Win10Style.ShowSystemMenu(this.Handle);
}
200字以内,仅用于支线交流,主线讨论请采用回复功能。