procedure TransparentPanel(var Target : TPanel);
var
I : Integer;
FullRgn, ClientRgn, ControlRgn : THandle;
Margin, MarginX, MarginY, X, Y : Integer;
begin
Margin := (Target.Width - Target.ClientWidth) div 2;
FullRgn := CreateRectRgn(0, 0, Target.Width, Target.Height);
MarginX := Margin;
MarginY := Target.Height - Target.ClientHeight - Margin;
ClientRgn :=
CreateRectRgn(
MarginX
, MarginY
, MarginX + Target.ClientWidth
, MarginY + Target.ClientHeight
);
CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
for I:=0 to Target.ControlCount-1 do begin
X := MarginX + Target.Controls[I].Left;
Y := MarginY + Target.Controls[I].Top;
ControlRgn :=
CreateRectRgn(
X
, Y
, X + Target.Controls[I].Width
, Y + Target.Controls[I].Height
);
CombineRgn(FullRgn, FullRgn, ControlRgn, RGN_OR);
end;
SetWindowRgn(Target.Handle, FullRgn, True);
end;
원본 : 어느 고수님..
'공부방 > Delphi' 카테고리의 다른 글
[DB2] 입력 데이터로 Insert / Update 실행 (0) | 2024.02.19 |
---|---|
[델파이] 특정프로세스 쓰레드 개수(Thread Count) 조회 (0) | 2023.12.28 |
[델파이] DBGrid Column Width 자동 설정 (0) | 2021.01.28 |
[델파이] 클래스명으로 폼 찾기(체크) (0) | 2019.06.10 |
[델파이] 가상메소드 (0) | 2018.04.06 |