K
kiven_lu
Unregistered / Unconfirmed
GUEST, unregistred user!
再form显示时,我用了windows api 函数
const
cMaxLblCaption: array [Boolean] of string = ('1', '2');
cWinMaxState: array [Boolean] of TWindowState = (wsNormal, wsMaximized);
WS_EX_LAYERED = $80000;
AC_SRC_OVER = $0;
AC_SRC_ALPHA = $1;
AC_SRC_NO_PREMULT_ALPHA = $1;
AC_SRC_NO_ALPHA = $2;
AC_DST_NO_PREMULT_ALPHA = $10;
AC_DST_NO_ALPHA = $20;
LWA_COLORKEY = $1;
LWA_ALPHA = $2;
ULW_COLORKEY = $1;
ULW_ALPHA = $2;
ULW_OPAQUE = $4;
procedure Tform_originality.FormCreate(Sender: TObject);
var
l:longint;
begin
l:=getWindowLong(Handle, GWL_EXSTYLE);
l := l Or WS_EX_LAYERED;
SetWindowLong (handle, GWL_EXSTYLE, l);
SetLayeredWindowAttributes (handle, 0, 245, LWA_ALPHA);
end;
用于使窗体实现半透明,可当窗体显示时,总是先出现一片黑色区域,然后在显示,刷新很慢,
不知有没有方法可解决????
const
cMaxLblCaption: array [Boolean] of string = ('1', '2');
cWinMaxState: array [Boolean] of TWindowState = (wsNormal, wsMaximized);
WS_EX_LAYERED = $80000;
AC_SRC_OVER = $0;
AC_SRC_ALPHA = $1;
AC_SRC_NO_PREMULT_ALPHA = $1;
AC_SRC_NO_ALPHA = $2;
AC_DST_NO_PREMULT_ALPHA = $10;
AC_DST_NO_ALPHA = $20;
LWA_COLORKEY = $1;
LWA_ALPHA = $2;
ULW_COLORKEY = $1;
ULW_ALPHA = $2;
ULW_OPAQUE = $4;
procedure Tform_originality.FormCreate(Sender: TObject);
var
l:longint;
begin
l:=getWindowLong(Handle, GWL_EXSTYLE);
l := l Or WS_EX_LAYERED;
SetWindowLong (handle, GWL_EXSTYLE, l);
SetLayeredWindowAttributes (handle, 0, 245, LWA_ALPHA);
end;
用于使窗体实现半透明,可当窗体显示时,总是先出现一片黑色区域,然后在显示,刷新很慢,
不知有没有方法可解决????