You've already forked lazarus-ccr
* Terminate compilation fix of SpkGUITools
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1703 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -10,7 +10,7 @@ interface
|
|||||||
{$MESSAGE HINT 'W tym module konsekwentnie ka¿dy rect opisuje dok³adny prostok¹t (a nie, jak w przypadku WINAPI - bez dolnej i prawej krawêdzi)'}
|
{$MESSAGE HINT 'W tym module konsekwentnie ka¿dy rect opisuje dok³adny prostok¹t (a nie, jak w przypadku WINAPI - bez dolnej i prawej krawêdzi)'}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLType, Graphics, SysUtils, Math, Classes, Controls, ImgList, SpkGraphTools, SpkMath;
|
LCLType, Graphics, SysUtils, Classes, Controls, SpkGraphTools, SpkMath;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCornerPos = (cpLeftTop, cpRightTop, cpLeftBottom, cpRightBottom);
|
TCornerPos = (cpLeftTop, cpRightTop, cpLeftBottom, cpRightBottom);
|
||||||
@ -297,14 +297,12 @@ type
|
|||||||
ClipRect : T2DIntRect); overload; inline;
|
ClipRect : T2DIntRect); overload; inline;
|
||||||
class procedure DrawMarkedText(ACanvas : TCanvas;
|
class procedure DrawMarkedText(ACanvas : TCanvas;
|
||||||
x, y : integer;
|
x, y : integer;
|
||||||
AText : string;
|
const AText, AMarkPhrase : string;
|
||||||
AMarkPhrase : string;
|
|
||||||
TextColor : TColor;
|
TextColor : TColor;
|
||||||
CaseSensitive : boolean = false); overload; inline;
|
CaseSensitive : boolean = false); overload; inline;
|
||||||
class procedure DrawMarkedText(ACanvas : TCanvas;
|
class procedure DrawMarkedText(ACanvas : TCanvas;
|
||||||
x, y : integer;
|
x, y : integer;
|
||||||
AText : string;
|
const AText, AMarkPhrase : string;
|
||||||
AMarkPhrase : string;
|
|
||||||
TextColor : TColor;
|
TextColor : TColor;
|
||||||
ClipRect : T2DIntRect;
|
ClipRect : T2DIntRect;
|
||||||
CaseSensitive : boolean = false); overload; inline;
|
CaseSensitive : boolean = false); overload; inline;
|
||||||
@ -371,7 +369,7 @@ end;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
IntfGraphics;
|
LCLIntf, IntfGraphics;
|
||||||
|
|
||||||
{ TSpkGUITools }
|
{ TSpkGUITools }
|
||||||
|
|
||||||
@ -544,24 +542,39 @@ if (ABuffer.width=0) or (ABuffer.height=0) or
|
|||||||
// Góra
|
// Góra
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$ifdef EnhancedRecordSupport}
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
||||||
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y),
|
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y),
|
||||||
|
{$else}
|
||||||
|
Create2DIntPoint(SrcPoint.x + radius, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x + radius, DstPoint.y),
|
||||||
|
{$endif}
|
||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius,
|
radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
// Dó³
|
// Dó³
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
||||||
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y + height - radius),
|
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y + height - radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
||||||
|
Create2DIntPoint(DstPoint.x + radius, DstPoint.y + height - radius),
|
||||||
|
{$ENDIF}
|
||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius,
|
radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
// Œrodek
|
// Œrodek
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
||||||
T2DIntPoint.create(DstPoint.x, DstPoint.y + radius),
|
T2DIntPoint.create(DstPoint.x, DstPoint.y + radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y + radius),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y + radius),
|
||||||
|
{$ENDIF}
|
||||||
width,
|
width,
|
||||||
height - 2*radius,
|
height - 2*radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
@ -573,8 +586,13 @@ CopyRectangle(ABuffer,
|
|||||||
if LeftTopRound then
|
if LeftTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
ClipRect,
|
ClipRect,
|
||||||
@ -582,8 +600,13 @@ if LeftTopRound then
|
|||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -592,8 +615,13 @@ else
|
|||||||
if RightTopRound then
|
if RightTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
ClipRect,
|
ClipRect,
|
||||||
@ -601,8 +629,13 @@ if RightTopRound then
|
|||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -611,8 +644,13 @@ else
|
|||||||
if LeftBottomRound then
|
if LeftBottomRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpLeftBottom,
|
cpLeftBottom,
|
||||||
ClipRect,
|
ClipRect,
|
||||||
@ -620,8 +658,13 @@ if LeftBottomRound then
|
|||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -630,8 +673,13 @@ else
|
|||||||
if RightBottomRound then
|
if RightBottomRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
ClipRect,
|
ClipRect,
|
||||||
@ -639,8 +687,13 @@ if RightBottomRound then
|
|||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION'}
|
{$ENDREGION'}
|
||||||
@ -667,22 +720,37 @@ if (ABuffer.width=0) or (ABuffer.height=0) or
|
|||||||
// Góra
|
// Góra
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
||||||
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y),
|
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + radius, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x + radius, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius);
|
radius);
|
||||||
// Dó³
|
// Dó³
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
||||||
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y + height - radius),
|
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y + height - radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
||||||
|
Create2DIntPoint(DstPoint.x + radius, DstPoint.y + height - radius),
|
||||||
|
{$ENDIF}
|
||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius);
|
radius);
|
||||||
// Œrodek
|
// Œrodek
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
||||||
T2DIntPoint.create(DstPoint.x, DstPoint.y + radius),
|
T2DIntPoint.create(DstPoint.x, DstPoint.y + radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y + radius),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y + radius),
|
||||||
|
{$ENDIF}
|
||||||
width,
|
width,
|
||||||
height - 2*radius);
|
height - 2*radius);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -692,16 +760,26 @@ CopyRectangle(ABuffer,
|
|||||||
if LeftTopRound then
|
if LeftTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
true)
|
true)
|
||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius);
|
Radius);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
@ -709,16 +787,26 @@ else
|
|||||||
if RightTopRound then
|
if RightTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
true)
|
true)
|
||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y),
|
||||||
|
{$ENDIF}
|
||||||
Radius);
|
Radius);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
@ -726,16 +814,26 @@ else
|
|||||||
if LeftBottomRound then
|
if LeftBottomRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpLeftBottom,
|
cpLeftBottom,
|
||||||
true)
|
true)
|
||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius);
|
Radius);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
@ -743,16 +841,26 @@ else
|
|||||||
if RightBottomRound then
|
if RightBottomRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius,
|
Radius,
|
||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
true)
|
true)
|
||||||
else
|
else
|
||||||
TGUITools.CopyCorner(ABuffer,
|
TGUITools.CopyCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
T2DIntPoint.Create(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
T2DIntPoint.Create(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ELSE}
|
||||||
|
Create2DIntPoint(SrcPoint.x + Width - Radius, SrcPoint.y + Height - Radius),
|
||||||
|
Create2DIntPoint(DstPoint.x + Width - Radius, DstPoint.y + Height - Radius),
|
||||||
|
{$ENDIF}
|
||||||
Radius);
|
Radius);
|
||||||
{$ENDREGION'}
|
{$ENDREGION'}
|
||||||
end;
|
end;
|
||||||
@ -781,6 +889,7 @@ if (Width<1) or (Height<1) then
|
|||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
|
||||||
@ -797,6 +906,24 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.x+Width-1,
|
DstPoint.x+Width-1,
|
||||||
DstPoint.y+Height-1),
|
DstPoint.y+Height-1),
|
||||||
DstRect)) then exit;
|
DstRect)) then exit;
|
||||||
|
{$ELSE}
|
||||||
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
|
BufferRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
|
||||||
|
if not(BufferRect.IntersectsWith(Create2DIntRect(SrcPoint.x,
|
||||||
|
SrcPoint.y,
|
||||||
|
SrcPoint.x+Width-1,
|
||||||
|
SrcPoint.y+Height-1),
|
||||||
|
SrcRect)) then exit;
|
||||||
|
|
||||||
|
// Przycinamy docelowy rect do obszaru docelowej bitmapy
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(DstPoint.x,
|
||||||
|
DstPoint.y,
|
||||||
|
DstPoint.x+Width-1,
|
||||||
|
DstPoint.y+Height-1),
|
||||||
|
DstRect)) then exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Liczymy offset Ÿród³owego do docelowego recta
|
// Liczymy offset Ÿród³owego do docelowego recta
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
@ -871,6 +998,7 @@ if (ABuffer.width=0) or (ABuffer.height=0) or
|
|||||||
if (ABuffer.Width<>AMask.Width) or
|
if (ABuffer.Width<>AMask.Width) or
|
||||||
(ABuffer.Height<>AMask.Height) then exit;
|
(ABuffer.Height<>AMask.Height) then exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
|
||||||
@ -887,6 +1015,24 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.x+Width-1,
|
DstPoint.x+Width-1,
|
||||||
DstPoint.y+Height-1),
|
DstPoint.y+Height-1),
|
||||||
DstRect)) then exit;
|
DstRect)) then exit;
|
||||||
|
{$ELSE}
|
||||||
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
|
BufferRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
|
||||||
|
if not(BufferRect.IntersectsWith(Create2DIntRect(SrcPoint.x,
|
||||||
|
SrcPoint.y,
|
||||||
|
SrcPoint.x+Width-1,
|
||||||
|
SrcPoint.y+Height-1),
|
||||||
|
SrcRect)) then exit;
|
||||||
|
|
||||||
|
// Przycinamy docelowy rect do obszaru docelowej bitmapy
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(DstPoint.x,
|
||||||
|
DstPoint.y,
|
||||||
|
DstPoint.x+Width-1,
|
||||||
|
DstPoint.y+Height-1),
|
||||||
|
DstRect)) then exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Liczymy offset Ÿród³owego do docelowego recta
|
// Liczymy offset Ÿród³owego do docelowego recta
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
@ -963,6 +1109,7 @@ if (ABuffer.Width<>AMask.Width) or
|
|||||||
(ABuffer.Height<>AMask.Height) then
|
(ABuffer.Height<>AMask.Height) then
|
||||||
raise exception.create('TSpkGUITools.CopyMaskRectangle: Maska ma nieprawid³owe rozmiary!');
|
raise exception.create('TSpkGUITools.CopyMaskRectangle: Maska ma nieprawid³owe rozmiary!');
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
@ -978,6 +1125,23 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.x+Width-1,
|
DstPoint.x+Width-1,
|
||||||
DstPoint.y+Height-1),
|
DstPoint.y+Height-1),
|
||||||
DstRect)) then exit;
|
DstRect)) then exit;
|
||||||
|
{$ELSE}
|
||||||
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
|
BufferRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
if not(BufferRect.IntersectsWith(Create2DIntRect(SrcPoint.x,
|
||||||
|
SrcPoint.y,
|
||||||
|
SrcPoint.x+Width-1,
|
||||||
|
SrcPoint.y+Height-1),
|
||||||
|
SrcRect)) then exit;
|
||||||
|
|
||||||
|
// Przycinamy docelowy rect do obszaru docelowej bitmapy
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(DstPoint.x,
|
||||||
|
DstPoint.y,
|
||||||
|
DstPoint.x+Width-1,
|
||||||
|
DstPoint.y+Height-1),
|
||||||
|
DstRect)) then exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Dodatkowo przycinamy docelowy rect
|
// Dodatkowo przycinamy docelowy rect
|
||||||
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
||||||
@ -1001,7 +1165,7 @@ begin
|
|||||||
SrcLine:=SrcImg.GetDataLineStart(y);
|
SrcLine:=SrcImg.GetDataLineStart(y);
|
||||||
SrcLine:=pointer(integer(SrcLine) + 3 * ClippedSrcRect.left);
|
SrcLine:=pointer(integer(SrcLine) + 3 * ClippedSrcRect.left);
|
||||||
|
|
||||||
MaskLine:=MaskImg.GetDataLineStart();
|
MaskLine:=MaskImg.GetDataLineStart(y);
|
||||||
MaskLine:=pointer(integer(MaskLine) + ClippedSrcRect.left);
|
MaskLine:=pointer(integer(MaskLine) + ClippedSrcRect.left);
|
||||||
|
|
||||||
DstLine:=DestImg.GetDataLineStart(y+Offset.y);
|
DstLine:=DestImg.GetDataLineStart(y+Offset.y);
|
||||||
@ -1048,6 +1212,7 @@ if (Width<1) or (Height<1) then
|
|||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
@ -1063,6 +1228,23 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.x+Width-1,
|
DstPoint.x+Width-1,
|
||||||
DstPoint.y+Height-1),
|
DstPoint.y+Height-1),
|
||||||
DstRect)) then exit;
|
DstRect)) then exit;
|
||||||
|
{$ELSE}
|
||||||
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
|
BufferRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
if not(BufferRect.IntersectsWith(Create2DIntRect(SrcPoint.x,
|
||||||
|
SrcPoint.y,
|
||||||
|
SrcPoint.x+Width-1,
|
||||||
|
SrcPoint.y+Height-1),
|
||||||
|
SrcRect)) then exit;
|
||||||
|
|
||||||
|
// Przycinamy docelowy rect do obszaru docelowej bitmapy
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(DstPoint.x,
|
||||||
|
DstPoint.y,
|
||||||
|
DstPoint.x+Width-1,
|
||||||
|
DstPoint.y+Height-1),
|
||||||
|
DstRect)) then exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Dodatkowo przycinamy docelowy rect
|
// Dodatkowo przycinamy docelowy rect
|
||||||
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
||||||
@ -1124,6 +1306,7 @@ if Radius<1 then
|
|||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
SrcPoint.y,
|
SrcPoint.y,
|
||||||
@ -1137,6 +1320,21 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.x+Radius-1,
|
DstPoint.x+Radius-1,
|
||||||
DstPoint.y+Radius-1),
|
DstPoint.y+Radius-1),
|
||||||
OrgDstRect)) then exit;
|
OrgDstRect)) then exit;
|
||||||
|
{$ELSE}
|
||||||
|
BufferRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
if not(BufferRect.IntersectsWith(Create2DIntRect(SrcPoint.x,
|
||||||
|
SrcPoint.y,
|
||||||
|
SrcPoint.x+Radius-1,
|
||||||
|
SrcPoint.y+Radius-1),
|
||||||
|
OrgSrcRect)) then exit;
|
||||||
|
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(DstPoint.x,
|
||||||
|
DstPoint.y,
|
||||||
|
DstPoint.x+Radius-1,
|
||||||
|
DstPoint.y+Radius-1),
|
||||||
|
OrgDstRect)) then exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
|
|
||||||
@ -1144,12 +1342,21 @@ if not(OrgSrcRect.IntersectsWith(OrgDstRect - Offset, SrcRect)) then exit;
|
|||||||
|
|
||||||
// Ustalamy pozycjê œrodka ³uku
|
// Ustalamy pozycjê œrodka ³uku
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(SrcPoint.x, SrcPoint.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(SrcPoint.x, SrcPoint.y + Radius - 1);
|
||||||
cpLeftBottom: Center:=T2DIntVector.Create(SrcPoint.x + radius - 1, SrcPoint.y);
|
cpLeftBottom: Center:=T2DIntVector.Create(SrcPoint.x + radius - 1, SrcPoint.y);
|
||||||
cpRightBottom: Center:=T2DIntVector.Create(SrcPoint.x, SrcPoint.y);
|
cpRightBottom: Center:=T2DIntVector.Create(SrcPoint.x, SrcPoint.y);
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
case CornerPos of
|
||||||
|
cpLeftTop: Center.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
||||||
|
cpRightTop: Center.create(SrcPoint.x, SrcPoint.y + Radius - 1);
|
||||||
|
cpLeftBottom: Center.Create(SrcPoint.x + radius - 1, SrcPoint.y);
|
||||||
|
cpRightBottom: Center.Create(SrcPoint.x, SrcPoint.y);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// Czy jest cokolwiek do przetworzenia?
|
// Czy jest cokolwiek do przetworzenia?
|
||||||
if Convex then
|
if Convex then
|
||||||
@ -1167,7 +1374,11 @@ if Convex then
|
|||||||
DstPtr:=pointer(integer(DstLine) + 3*(SrcRect.left + Offset.x));
|
DstPtr:=pointer(integer(DstLine) + 3*(SrcRect.left + Offset.x));
|
||||||
for x := SrcRect.left to SrcRect.right do
|
for x := SrcRect.left to SrcRect.right do
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
Dist:=Center.DistanceTo(T2DVector.create(x, y));
|
Dist:=Center.DistanceTo(T2DVector.create(x, y));
|
||||||
|
{$ELSE}
|
||||||
|
Dist:=Center.DistanceTo(x, y);
|
||||||
|
{$ENDIF}
|
||||||
if Dist <= (Radius-1) then
|
if Dist <= (Radius-1) then
|
||||||
Move(SrcPtr^,DstPtr^,3);
|
Move(SrcPtr^,DstPtr^,3);
|
||||||
|
|
||||||
@ -1195,7 +1406,11 @@ else
|
|||||||
DstPtr:=pointer(integer(DstLine) + 3*(SrcRect.left + Offset.x));
|
DstPtr:=pointer(integer(DstLine) + 3*(SrcRect.left + Offset.x));
|
||||||
for x := SrcRect.left to SrcRect.right do
|
for x := SrcRect.left to SrcRect.right do
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
Dist:=Center.DistanceTo(T2DVector.create(x, y));
|
Dist:=Center.DistanceTo(T2DVector.create(x, y));
|
||||||
|
{$ELSE}
|
||||||
|
Dist:=Center.DistanceTo(x, y);
|
||||||
|
{$ENDIF}
|
||||||
if Dist >= (Radius-1) then
|
if Dist >= (Radius-1) then
|
||||||
Move(SrcPtr^,DstPtr^,3);
|
Move(SrcPtr^,DstPtr^,3);
|
||||||
|
|
||||||
@ -1234,6 +1449,7 @@ if Radius<1 then
|
|||||||
if (ABitmap.width=0) or (ABitmap.height=0) then
|
if (ABitmap.width=0) or (ABitmap.height=0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// ród³owy rect...
|
// ród³owy rect...
|
||||||
OrgCornerRect:=T2DIntRect.create(Point.x,
|
OrgCornerRect:=T2DIntRect.create(Point.x,
|
||||||
Point.y,
|
Point.y,
|
||||||
@ -1242,6 +1458,17 @@ OrgCornerRect:=T2DIntRect.create(Point.x,
|
|||||||
|
|
||||||
// ...przycinamy do rozmiarów bitmapy
|
// ...przycinamy do rozmiarów bitmapy
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
{$ELSE}
|
||||||
|
// ród³owy rect...
|
||||||
|
OrgCornerRect.create(Point.x,
|
||||||
|
Point.y,
|
||||||
|
Point.x + radius - 1,
|
||||||
|
Point.y + radius - 1);
|
||||||
|
|
||||||
|
// ...przycinamy do rozmiarów bitmapy
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
if not(BitmapRect.intersectsWith(OrgCornerRect, CornerRect)) then
|
if not(BitmapRect.intersectsWith(OrgCornerRect, CornerRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -1250,12 +1477,21 @@ if (CornerRect.left>CornerRect.right) or (CornerRect.top>CornerRect.bottom) then
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
||||||
cpLeftBottom: Center:=T2DIntVector.Create(Point.x + radius - 1, Point.y);
|
cpLeftBottom: Center:=T2DIntVector.Create(Point.x + radius - 1, Point.y);
|
||||||
cpRightBottom: Center:=T2DIntVector.Create(Point.x, Point.y);
|
cpRightBottom: Center:=T2DIntVector.Create(Point.x, Point.y);
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
case CornerPos of
|
||||||
|
cpLeftTop: Center.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
|
cpRightTop: Center.create(Point.x, Point.y + Radius - 1);
|
||||||
|
cpLeftBottom: Center.Create(Point.x + radius - 1, Point.y);
|
||||||
|
cpRightBottom: Center.Create(Point.x, Point.y);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
Color:=ColorToRGB(Color);
|
Color:=ColorToRGB(Color);
|
||||||
|
|
||||||
@ -1268,7 +1504,11 @@ for y := CornerRect.top to CornerRect.bottom do
|
|||||||
Line:=DestImg.GetDataLineStart(y);
|
Line:=DestImg.GetDataLineStart(y);
|
||||||
for x := CornerRect.left to CornerRect.right do
|
for x := CornerRect.left to CornerRect.right do
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(T2DIntVector.create(x, y)));
|
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(T2DIntVector.create(x, y)));
|
||||||
|
{$ELSE}
|
||||||
|
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(x, y));
|
||||||
|
{$ENDIF}
|
||||||
if RadiusDist>0 then
|
if RadiusDist>0 then
|
||||||
begin
|
begin
|
||||||
Ptr:=pointer(integer(Line) + 3*x);
|
Ptr:=pointer(integer(Line) + 3*x);
|
||||||
@ -1308,6 +1548,7 @@ if Radius<1 then
|
|||||||
if (ABitmap.width=0) or (ABitmap.height=0) then
|
if (ABitmap.width=0) or (ABitmap.height=0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// ród³owy rect...
|
// ród³owy rect...
|
||||||
OrgCornerRect:=T2DIntRect.create(Point.x,
|
OrgCornerRect:=T2DIntRect.create(Point.x,
|
||||||
Point.y,
|
Point.y,
|
||||||
@ -1316,6 +1557,17 @@ OrgCornerRect:=T2DIntRect.create(Point.x,
|
|||||||
|
|
||||||
// ...przycinamy do rozmiarów bitmapy
|
// ...przycinamy do rozmiarów bitmapy
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
{$ELSE}
|
||||||
|
// ród³owy rect...
|
||||||
|
OrgCornerRect.create(Point.x,
|
||||||
|
Point.y,
|
||||||
|
Point.x + radius - 1,
|
||||||
|
Point.y + radius - 1);
|
||||||
|
|
||||||
|
// ...przycinamy do rozmiarów bitmapy
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
if not(BitmapRect.intersectsWith(OrgCornerRect, UnClippedCornerRect)) then
|
if not(BitmapRect.intersectsWith(OrgCornerRect, UnClippedCornerRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -1328,12 +1580,21 @@ if (CornerRect.left>CornerRect.right) or (CornerRect.top>CornerRect.bottom) then
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
||||||
cpLeftBottom: Center:=T2DIntVector.Create(Point.x + radius - 1, Point.y);
|
cpLeftBottom: Center:=T2DIntVector.Create(Point.x + radius - 1, Point.y);
|
||||||
cpRightBottom: Center:=T2DIntVector.Create(Point.x, Point.y);
|
cpRightBottom: Center:=T2DIntVector.Create(Point.x, Point.y);
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
case CornerPos of
|
||||||
|
cpLeftTop: Center.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
|
cpRightTop: Center.create(Point.x, Point.y + Radius - 1);
|
||||||
|
cpLeftBottom: Center.Create(Point.x + radius - 1, Point.y);
|
||||||
|
cpRightBottom: Center.Create(Point.x, Point.y);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
Color:=ColorToRGB(Color);
|
Color:=ColorToRGB(Color);
|
||||||
|
|
||||||
@ -1347,7 +1608,11 @@ for y := CornerRect.top to CornerRect.bottom do
|
|||||||
Line:=DestImg.GetDataLineStart(y);
|
Line:=DestImg.GetDataLineStart(y);
|
||||||
for x := CornerRect.left to CornerRect.right do
|
for x := CornerRect.left to CornerRect.right do
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(T2DIntVector.create(x, y)));
|
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(T2DIntVector.create(x, y)));
|
||||||
|
{$ELSE}
|
||||||
|
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(x, y));
|
||||||
|
{$ENDIF}
|
||||||
if RadiusDist>0 then
|
if RadiusDist>0 then
|
||||||
begin
|
begin
|
||||||
Ptr:=pointer(integer(Line) + 3*x);
|
Ptr:=pointer(integer(Line) + 3*x);
|
||||||
@ -1375,6 +1640,7 @@ begin
|
|||||||
if Radius<1 then
|
if Radius<1 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
// ród³owy rect...
|
// ród³owy rect...
|
||||||
CornerRect:=T2DIntRect.create(Point.x,
|
CornerRect:=T2DIntRect.create(Point.x,
|
||||||
Point.y,
|
Point.y,
|
||||||
@ -1388,6 +1654,21 @@ case CornerPos of
|
|||||||
cpLeftBottom: Center:=T2DIntVector.Create(Point.x + radius - 1, Point.y);
|
cpLeftBottom: Center:=T2DIntVector.Create(Point.x + radius - 1, Point.y);
|
||||||
cpRightBottom: Center:=T2DIntVector.Create(Point.x, Point.y);
|
cpRightBottom: Center:=T2DIntVector.Create(Point.x, Point.y);
|
||||||
end;
|
end;
|
||||||
|
{$ELSE}
|
||||||
|
// ród³owy rect...
|
||||||
|
CornerRect.create(Point.x,
|
||||||
|
Point.y,
|
||||||
|
Point.x + radius - 1,
|
||||||
|
Point.y + radius - 1);
|
||||||
|
|
||||||
|
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
||||||
|
case CornerPos of
|
||||||
|
cpLeftTop: Center.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
|
cpRightTop: Center.create(Point.x, Point.y + Radius - 1);
|
||||||
|
cpLeftBottom: Center.Create(Point.x + radius - 1, Point.y);
|
||||||
|
cpRightBottom: Center.Create(Point.x, Point.y);
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
Color:=ColorToRGB(Color);
|
Color:=ColorToRGB(Color);
|
||||||
|
|
||||||
@ -1395,7 +1676,11 @@ for y := CornerRect.top to CornerRect.bottom do
|
|||||||
begin
|
begin
|
||||||
for x := CornerRect.left to CornerRect.right do
|
for x := CornerRect.left to CornerRect.right do
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(T2DIntVector.create(x, y)));
|
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(T2DIntVector.create(x, y)));
|
||||||
|
{$ELSE}
|
||||||
|
RadiusDist:=1 - abs((Radius - 1) - Center.DistanceTo(x, y));
|
||||||
|
{$ENDIF}
|
||||||
if RadiusDist>0 then
|
if RadiusDist>0 then
|
||||||
begin
|
begin
|
||||||
OrgColor:=ACanvas.Pixels[x, y];
|
OrgColor:=ACanvas.Pixels[x, y];
|
||||||
@ -1443,10 +1728,17 @@ if (Radius>Rect.width div 2) or (Radius>Rect.height div 2) then
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
// DrawAARoundCorner jest zabezpieczony przed rysowaniem poza obszarem
|
// DrawAARoundCorner jest zabezpieczony przed rysowaniem poza obszarem
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.top), Radius, cpLeftTop, Color, ClipRect);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.top), Radius, cpLeftTop, Color, ClipRect);
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color, ClipRect);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color, ClipRect);
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color, ClipRect);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color, ClipRect);
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color, ClipRect);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color, ClipRect);
|
||||||
|
{$ELSE}
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.left, Rect.top), Radius, cpLeftTop, Color, ClipRect);
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color, ClipRect);
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color, ClipRect);
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color, ClipRect);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
ABitmap.Canvas.Pen.color:=Color;
|
ABitmap.Canvas.Pen.color:=Color;
|
||||||
ABitmap.Canvas.pen.style:=psSolid;
|
ABitmap.Canvas.pen.style:=psSolid;
|
||||||
@ -1472,10 +1764,17 @@ if (Radius>Rect.width div 2) or (Radius>Rect.height div 2) then
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
// DrawAARoundCorner jest zabezpieczony przed rysowaniem poza obszarem
|
// DrawAARoundCorner jest zabezpieczony przed rysowaniem poza obszarem
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.top), Radius, cpLeftTop, Color);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.top), Radius, cpLeftTop, Color);
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color);
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color);
|
||||||
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color);
|
DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color);
|
||||||
|
{$ELSE}
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.left, Rect.top), Radius, cpLeftTop, Color);
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color);
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color);
|
||||||
|
DrawAARoundCorner(ABitmap, Create2DIntVector(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
ABitmap.canvas.Pen.color:=Color;
|
ABitmap.canvas.Pen.color:=Color;
|
||||||
ABitmap.canvas.pen.style:=psSolid;
|
ABitmap.canvas.pen.style:=psSolid;
|
||||||
@ -1596,7 +1895,7 @@ RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
|||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TGUITools.DrawMarkedText(ACanvas: TCanvas; x, y: integer; AText,
|
class procedure TGUITools.DrawMarkedText(ACanvas: TCanvas; x, y: integer; const AText,
|
||||||
AMarkPhrase: string; TextColor : TColor; ClipRect: T2DIntRect; CaseSensitive: boolean);
|
AMarkPhrase: string; TextColor : TColor; ClipRect: T2DIntRect; CaseSensitive: boolean);
|
||||||
|
|
||||||
var UseOrgClipRgn: Boolean;
|
var UseOrgClipRgn: Boolean;
|
||||||
@ -1619,10 +1918,10 @@ RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
|||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TGUITools.DrawMarkedText(ACanvas: TCanvas; x, y: integer; AText,
|
class procedure TGUITools.DrawMarkedText(ACanvas: TCanvas; x, y: integer; const AText,
|
||||||
AMarkPhrase: string; TextColor : TColor; CaseSensitive : boolean);
|
AMarkPhrase: string; TextColor : TColor; CaseSensitive : boolean);
|
||||||
|
|
||||||
var DrawText : string;
|
var TextToDraw : string;
|
||||||
BaseText : string;
|
BaseText : string;
|
||||||
MarkText : string;
|
MarkText : string;
|
||||||
MarkPos: Integer;
|
MarkPos: Integer;
|
||||||
@ -1631,7 +1930,7 @@ var DrawText : string;
|
|||||||
MarkTextLength: Integer;
|
MarkTextLength: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
DrawText:=AText;
|
TextToDraw:=AText;
|
||||||
if CaseSensitive then
|
if CaseSensitive then
|
||||||
begin
|
begin
|
||||||
BaseText:=AText;
|
BaseText:=AText;
|
||||||
@ -1656,23 +1955,23 @@ while MarkPos>0 do
|
|||||||
begin
|
begin
|
||||||
// Rysowanie tekstu przed wyró¿nionym
|
// Rysowanie tekstu przed wyró¿nionym
|
||||||
ACanvas.Font.Style:=ACanvas.Font.Style - [fsBold];
|
ACanvas.Font.Style:=ACanvas.Font.Style - [fsBold];
|
||||||
s:=copy(DrawText, 1, MarkPos-1);
|
s:=copy(TextToDraw, 1, MarkPos-1);
|
||||||
|
|
||||||
ACanvas.TextOut(x1, y, s);
|
ACanvas.TextOut(x1, y, s);
|
||||||
inc(x1, ACanvas.TextWidth(s)+1);
|
inc(x1, ACanvas.TextWidth(s)+1);
|
||||||
|
|
||||||
delete(DrawText, 1, MarkPos-1);
|
delete(TextToDraw, 1, MarkPos-1);
|
||||||
delete(BaseText, 1, MarkPos-1);
|
delete(BaseText, 1, MarkPos-1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Rysowanie wyró¿nionego tekstu
|
// Rysowanie wyró¿nionego tekstu
|
||||||
ACanvas.Font.Style:=ACanvas.Font.Style + [fsBold];
|
ACanvas.Font.Style:=ACanvas.Font.Style + [fsBold];
|
||||||
s:=copy(DrawText, 1, MarkTextLength);
|
s:=copy(TextToDraw, 1, MarkTextLength);
|
||||||
|
|
||||||
ACanvas.TextOut(x1, y, s);
|
ACanvas.TextOut(x1, y, s);
|
||||||
inc(x1, ACanvas.TextWidth(s)+1);
|
inc(x1, ACanvas.TextWidth(s)+1);
|
||||||
|
|
||||||
delete(DrawText, 1, MarkTextLength);
|
delete(TextToDraw, 1, MarkTextLength);
|
||||||
delete(BaseText, 1, MarkTextLength);
|
delete(BaseText, 1, MarkTextLength);
|
||||||
|
|
||||||
MarkPos:=pos(MarkText, BaseText);
|
MarkPos:=pos(MarkText, BaseText);
|
||||||
@ -1681,7 +1980,7 @@ while MarkPos>0 do
|
|||||||
if Length(BaseText)>0 then
|
if Length(BaseText)>0 then
|
||||||
begin
|
begin
|
||||||
ACanvas.Font.Style:=ACanvas.Font.Style - [fsBold];
|
ACanvas.Font.Style:=ACanvas.Font.Style - [fsBold];
|
||||||
ACanvas.TextOut(x1, y, DrawText);
|
ACanvas.TextOut(x1, y, TextToDraw);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1755,9 +2054,15 @@ if x2<x1 then
|
|||||||
x2:=tmp;
|
x2:=tmp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x1, y, x2, y), LineRect)) then
|
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x1, y, x2, y), LineRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
{$ELSE}
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(x1, y, x2, y), LineRect)) then
|
||||||
|
exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
ABitmap.canvas.pen.color:=Color;
|
ABitmap.canvas.pen.color:=Color;
|
||||||
ABitmap.canvas.pen.style:=psSolid;
|
ABitmap.canvas.pen.style:=psSolid;
|
||||||
@ -1784,9 +2089,15 @@ if x2<x1 then
|
|||||||
x2:=tmp;
|
x2:=tmp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x1, y, x2, y), OrgLineRect)) then
|
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x1, y, x2, y), OrgLineRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
{$ELSE}
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(x1, y, x2, y), OrgLineRect)) then
|
||||||
|
exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
if not(OrgLineRect.IntersectsWith(ClipRect, LineRect)) then
|
if not(OrgLineRect.IntersectsWith(ClipRect, LineRect)) then
|
||||||
exit;
|
exit;
|
||||||
@ -2086,8 +2397,8 @@ end;
|
|||||||
|
|
||||||
class procedure TGUITools.FillGradientRectangle(ACanvas: TCanvas; Rect: T2DIntRect; ColorFrom: TColor; ColorTo: TColor; GradientKind: TBackgroundKind);
|
class procedure TGUITools.FillGradientRectangle(ACanvas: TCanvas; Rect: T2DIntRect; ColorFrom: TColor; ColorTo: TColor; GradientKind: TBackgroundKind);
|
||||||
var
|
var
|
||||||
Mesh: array of _GRADIENT_RECT;
|
Mesh: array of GRADIENTRECT;
|
||||||
GradientVertice: array of _TRIVERTEX;
|
GradientVertice: array of TRIVERTEX;
|
||||||
ConcaveColor: TColor;
|
ConcaveColor: TColor;
|
||||||
begin
|
begin
|
||||||
case GradientKind of
|
case GradientKind of
|
||||||
@ -2233,20 +2544,34 @@ case BackgroundKind of
|
|||||||
TGradientTools.HGradient(ABuffer.canvas, Color1, Color2, Rect.ForWinAPI);
|
TGradientTools.HGradient(ABuffer.canvas, Color1, Color2, Rect.ForWinAPI);
|
||||||
end;
|
end;
|
||||||
bkConcave: begin
|
bkConcave: begin
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
TempRect:=T2DIntRect.create(rect.Left,
|
TempRect:=T2DIntRect.create(rect.Left,
|
||||||
rect.top,
|
rect.top,
|
||||||
rect.right,
|
rect.right,
|
||||||
rect.Top + (rect.bottom - rect.top) div 4);
|
rect.Top + (rect.bottom - rect.top) div 4);
|
||||||
|
{$ELSE}
|
||||||
|
TempRect.create(rect.Left,
|
||||||
|
rect.top,
|
||||||
|
rect.right,
|
||||||
|
rect.Top + (rect.bottom - rect.top) div 4);
|
||||||
|
{$ENDIF}
|
||||||
TGradientTools.VGradient(ABuffer.Canvas,
|
TGradientTools.VGradient(ABuffer.Canvas,
|
||||||
Color1,
|
Color1,
|
||||||
TColorTools.Shade(Color1, Color2, 20),
|
TColorTools.Shade(Color1, Color2, 20),
|
||||||
TempRect.ForWinAPI
|
TempRect.ForWinAPI
|
||||||
);
|
);
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
TempRect:=T2DIntRect.create(rect.Left,
|
TempRect:=T2DIntRect.create(rect.Left,
|
||||||
rect.top + (rect.bottom - rect.top) div 4 + 1,
|
rect.top + (rect.bottom - rect.top) div 4 + 1,
|
||||||
rect.right,
|
rect.right,
|
||||||
rect.bottom);
|
rect.bottom);
|
||||||
|
{$ELSE}
|
||||||
|
TempRect.create(rect.Left,
|
||||||
|
rect.top + (rect.bottom - rect.top) div 4 + 1,
|
||||||
|
rect.right,
|
||||||
|
rect.bottom);
|
||||||
|
{$ENDIF}
|
||||||
TGradientTools.VGradient(ABuffer.Canvas,
|
TGradientTools.VGradient(ABuffer.Canvas,
|
||||||
Color2,
|
Color2,
|
||||||
Color1,
|
Color1,
|
||||||
@ -2307,9 +2632,15 @@ if y2<y1 then
|
|||||||
y2:=tmp;
|
y2:=tmp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x, y1, x, y2), LineRect)) then
|
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x, y1, x, y2), LineRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
{$ELSE}
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(x, y1, x, y2), LineRect)) then
|
||||||
|
exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
ABitmap.canvas.pen.color:=Color;
|
ABitmap.canvas.pen.color:=Color;
|
||||||
ABitmap.canvas.pen.style:=psSolid;
|
ABitmap.canvas.pen.style:=psSolid;
|
||||||
@ -2336,9 +2667,15 @@ if y2<y1 then
|
|||||||
y2:=tmp;
|
y2:=tmp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x, y1, x, y2), OrgLineRect)) then
|
if not(BitmapRect.IntersectsWith(T2DIntRect.create(x, y1, x, y2), OrgLineRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
{$ELSE}
|
||||||
|
BitmapRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
|
if not(BitmapRect.IntersectsWith(Create2DIntRect(x, y1, x, y2), OrgLineRect)) then
|
||||||
|
exit;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
if not(OrgLineRect.IntersectsWith(ClipRect, LineRect)) then
|
if not(OrgLineRect.IntersectsWith(ClipRect, LineRect)) then
|
||||||
exit;
|
exit;
|
||||||
@ -2402,10 +2739,17 @@ if (Radius>Rect.width div 2) or (Radius>Rect.height div 2) then
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
// DrawAARoundCorner jest zabezpieczony przed rysowaniem poza obszarem
|
// DrawAARoundCorner jest zabezpieczony przed rysowaniem poza obszarem
|
||||||
|
{$IFDEF EnhancedRecordSupport}
|
||||||
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.left, Rect.top), Radius, cpLeftTop, Color);
|
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.left, Rect.top), Radius, cpLeftTop, Color);
|
||||||
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color);
|
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color);
|
||||||
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color);
|
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color);
|
||||||
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color);
|
DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color);
|
||||||
|
{$ELSE}
|
||||||
|
DrawAARoundCorner(ACanvas, Create2DIntVector(Rect.left, Rect.top), Radius, cpLeftTop, Color);
|
||||||
|
DrawAARoundCorner(ACanvas, Create2DIntVector(Rect.right - Radius + 1, Rect.top), Radius, cpRightTop, Color);
|
||||||
|
DrawAARoundCorner(ACanvas, Create2DIntVector(Rect.left, Rect.bottom - Radius + 1), Radius, cpLeftBottom, Color);
|
||||||
|
DrawAARoundCorner(ACanvas, Create2DIntVector(Rect.Right - Radius + 1, Rect.Bottom - Radius + 1), Radius, cpRightBottom, Color);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
ACanvas.Pen.color:=Color;
|
ACanvas.Pen.color:=Color;
|
||||||
ACanvas.pen.style:=psSolid;
|
ACanvas.pen.style:=psSolid;
|
||||||
|
@ -294,6 +294,13 @@ type
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{$ifndef EnhancedRecordSupport}
|
{$ifndef EnhancedRecordSupport}
|
||||||
|
|
||||||
|
function Create2DIntVector(Ax, Ay : Integer): T2DIntVector;
|
||||||
|
|
||||||
|
function Create2DIntPoint(Ax, Ay : Integer): T2DIntPoint;
|
||||||
|
|
||||||
|
function Create2DIntRect(ALeft, ATop, ARight, ABottom: Integer): T2DIntRect;
|
||||||
|
|
||||||
operator - (Left: T2DIntVector; Right: T2DIntVector): T2DIntVector;
|
operator - (Left: T2DIntVector; Right: T2DIntVector): T2DIntVector;
|
||||||
|
|
||||||
operator - (Left: T2DIntRect; Right: T2DIntVector): T2DIntRect;
|
operator - (Left: T2DIntRect; Right: T2DIntVector): T2DIntRect;
|
||||||
@ -309,6 +316,21 @@ implementation
|
|||||||
|
|
||||||
{$ifndef EnhancedRecordSupport}
|
{$ifndef EnhancedRecordSupport}
|
||||||
|
|
||||||
|
function Create2DIntVector(Ax, Ay: Integer): T2DIntVector;
|
||||||
|
begin
|
||||||
|
Result.Create(Ax, Ay);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function Create2DIntPoint(Ax, Ay: Integer): T2DIntPoint;
|
||||||
|
begin
|
||||||
|
Result.Create(Ax, Ay);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function Create2DIntRect(ALeft, ATop, ARight, ABottom: Integer): T2DIntRect;
|
||||||
|
begin
|
||||||
|
Result.Create(ALeft, ATop, ARight, ABottom);
|
||||||
|
end;
|
||||||
|
|
||||||
operator - (Left: T2DIntVector; Right: T2DIntVector): T2DIntVector;
|
operator - (Left: T2DIntVector; Right: T2DIntVector): T2DIntVector;
|
||||||
begin
|
begin
|
||||||
Result.x := Left.x - Right.x;
|
Result.x := Left.x - Right.x;
|
||||||
|
Reference in New Issue
Block a user