📄 tecircle.pas
字号:
UpdateRect.Bottom);
UnUpdateRect := CalcRect(Data.Width, {Data.Height,} CurrentFrame - Step, True);
end;
procedure TCircleTransition.Style2_5Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect({W, H, }Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := -R;
c2 := -R;
c3 := R;
c4 := R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect({Data.Width, Data.Height,} CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect({Data.Width, Data.Height,} CurrentFrame, False, True);
if Draw then
with CalcRect({Data.Width, Data.Height,} CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style2_6Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W, H, Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := W - R;
c2 := H - R;
c3 := W + R;
c4 := H + R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect(Data.Width, Data.Height, CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame, False, True);
if Draw then
with CalcRect(Data.Width, Data.Height, CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style2_7Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect({W,} H, Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := - R;
c2 := H - R;
c3 := R;
c4 := H + R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect({Data.Width, }Data.Height, CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect({Data.Width, }Data.Height, CurrentFrame, False, True);
if Draw then
with CalcRect({Data.Width, }Data.Height, CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style2_8Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W,{ H, }Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := W - R;
c2 := - R;
c3 := W + R;
c4 := R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect(Data.Width, {Data.Height,} CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect(Data.Width, {Data.Height,} CurrentFrame, False, True);
if Draw then
with CalcRect(Data.Width,{ Data.Height,} CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style3_1Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect({W,} H, Frame: Integer; ForUnUpdateRect: Boolean): TRect;
var
D: Integer;
c1, c2, c3, c4: Integer;
begin
c1 := -Frame;
c2 := (H div 2) - Frame;
c3 := Frame;
c4 := (H div 2) + Frame;
Result := Rect(c1, c2, c3, c4);
if ForUnUpdateRect then
begin
D := -(Frame - Round(Sqrt(Sqr(Frame) div 2)));
InflateRect(Result, D-1, D-1);
end;
end;
begin
UpdateRect := CalcRect({Data.Width, }Data.Height, CurrentFrame, False);
if Draw then
MaskBmp.Canvas.Ellipse(UpdateRect.Left, UpdateRect.Top, UpdateRect.Right,
UpdateRect.Bottom);
UnUpdateRect := CalcRect({Data.Width,} Data.Height, CurrentFrame - Step, True);
end;
procedure TCircleTransition.Style3_2Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W, H, Frame: Integer; ForUnUpdateRect: Boolean): TRect;
var
D: Integer;
c1, c2, c3, c4: Integer;
begin
c1 := W - Frame;
c2 := (H div 2) - Frame;
c3 := W + Frame;
c4 := (H div 2) + Frame;
Result := Rect(c1, c2, c3, c4);
if ForUnUpdateRect then
begin
D := -(Frame - Round(Sqrt(Sqr(Frame) div 2)));
InflateRect(Result, D-1, D-1);
end;
end; //EROC itnA
begin
UpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame, False);
if Draw then
MaskBmp.Canvas.Ellipse(UpdateRect.Left, UpdateRect.Top, UpdateRect.Right,
UpdateRect.Bottom);
UnUpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame - Step, True);
end;
procedure TCircleTransition.Style3_3Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W,{ H,} Frame: Integer; ForUnUpdateRect: Boolean): TRect;
var
D: Integer;
c1, c2, c3, c4: Integer;
begin
c1 := (W div 2) - Frame;
c2 := -Frame;
c3 := (W div 2) + Frame;
c4 := Frame;
Result := Rect(c1, c2, c3, c4);
if ForUnUpdateRect then
begin
D := -(Frame - Round(Sqrt(Sqr(Frame) div 2)));
InflateRect(Result, D-1, D-1);
end;
end;
begin
UpdateRect := CalcRect(Data.Width, {Data.Height,} CurrentFrame, False);
if Draw then
MaskBmp.Canvas.Ellipse(UpdateRect.Left, UpdateRect.Top, UpdateRect.Right,
UpdateRect.Bottom);
UnUpdateRect := CalcRect(Data.Width, {Data.Height,} CurrentFrame - Step, True);
end;
procedure TCircleTransition.Style3_4Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W, H, Frame: Integer; ForUnUpdateRect: Boolean): TRect;
var
D: Integer;
c1, c2, c3, c4: Integer;
begin
c1 := (W div 2) - Frame;
c2 := H - Frame;
c3 := (W div 2) + Frame;
c4 := H + Frame;
Result := Rect(c1, c2, c3, c4);
if ForUnUpdateRect then
begin
D := -(Frame - Round(Sqrt(Sqr(Frame) div 2)));
InflateRect(Result, D-1, D-1);
end;
end;
begin
UpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame, False);
if Draw then
MaskBmp.Canvas.Ellipse(UpdateRect.Left, UpdateRect.Top, UpdateRect.Right,
UpdateRect.Bottom);
UnUpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame - Step, True);
end;
procedure TCircleTransition.Style3_5Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect({W,} H, Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := -R;
c2 := (H div 2) - R;
c3 := R;
c4 := (H div 2) + R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect({Data.Width,} Data.Height, CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect({Data.Width,} Data.Height, CurrentFrame, False, True);
if Draw then
with CalcRect({Data.Width,} Data.Height, CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style3_6Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W, H, Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := W - R;
c2 := (H div 2) - R;
c3 := W + R;
c4 := (H div 2) + R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect(Data.Width, Data.Height, CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame, False, True);
if Draw then
with CalcRect(Data.Width, Data.Height, CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style3_7Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W, {H,} Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := (W div 2) - R;
c2 := -R;
c3 := (W div 2) + R;
c4 := R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect(Data.Width,{ Data.Height,} CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect(Data.Width,{ Data.Height,} CurrentFrame, False, True);
if Draw then
with CalcRect(Data.Width, {Data.Height,} CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
procedure TCircleTransition.Style3_8Frame(MaskBmp: TBitmap;
Data: TTETransitionData; CurrentFrame, Step: Longint; Draw: Boolean);
function CalcRect(W, H, Frame: Integer;
ForUpdateRect, ForUnUpdateRect: Boolean): TRect;
var
R, D: Integer;
c1, c2, c3, c4: Integer;
begin
R := TotalFramesValue - Frame;
c1 := (W div 2) - R;
c2 := H - R;
c3 := (W div 2) + R;
c4 := H + R;
Result := Rect(c1, c2, c3, c4);
if ForUpdateRect then
InflateRect(Result, Step, Step);
if ForUnUpdateRect then
begin
D := (R+1) - Round(Sqrt(Sqr(R) div 2));
InflateRect(Result, -D, -D);
end;
end;
begin
UpdateRect :=
CalcRect(Data.Width, Data.Height, CurrentFrame - Step, True, False);
UnUpdateRect := CalcRect(Data.Width, Data.Height, CurrentFrame, False, True);
if Draw then
with CalcRect(Data.Width, Data.Height, CurrentFrame, False, False) do
MaskBmp.Canvas.Ellipse(Left, Top, Right, Bottom);
end;
initialization
TERegisterTransition(TCircleTransition);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -