有没有办法在画布上绘制然后使用updatelayeredwindow,所以不会看到表单,但文本,如只显示文本的transculent表单?如果没有,那么有没有办法制作某种只有画布(opengl/directx)的变形形式?我想在所有窗口的顶部绘制命令.
我想创建一个按钮和一个带圆角的容器。我正在使用区域来绘制角落,代码附在下面。然而,角落似乎并不平滑,有什么方法可以解决这个问题,任何帮助将不胜感激。下面附上图片,因为我还不允许上传图片。
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn(
int nLeftRect,
int nTopRect,
int nRightRect,
int nBottomRect,
int nWidthEllipse,
int nHeightEllipse
);
Run Code Online (Sandbox Code Playgroud)
public Login()
{
InitializeComponent();
this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 30, 30));
this.logo.Image = Properties.Resources.logo;
this.btn_login.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, this.btn_login.Width, this.btn_login.Height, 10, 10));
}
Run Code Online (Sandbox Code Playgroud)