|
@@ -387,6 +387,7 @@ type
|
|
|
procedure setKeepAspectRatio(const Value: boolean);
|
|
procedure setKeepAspectRatio(const Value: boolean);
|
|
|
procedure setMinHeight(const Value: integer);
|
|
procedure setMinHeight(const Value: integer);
|
|
|
procedure setMinWidth(const Value: integer);
|
|
procedure setMinWidth(const Value: integer);
|
|
|
|
|
+ procedure SetOpacity(AValue: Byte);
|
|
|
procedure setSelectedCropArea(AValue: TCropArea);
|
|
procedure setSelectedCropArea(AValue: TCropArea);
|
|
|
protected
|
|
protected
|
|
|
{ Protected declarations }
|
|
{ Protected declarations }
|
|
@@ -401,6 +402,7 @@ type
|
|
|
rOnCropAreaSave: TCropAreaSaveEvent;
|
|
rOnCropAreaSave: TCropAreaSaveEvent;
|
|
|
rEmptyImage: TBGRAEmptyImage;
|
|
rEmptyImage: TBGRAEmptyImage;
|
|
|
rLoading: Boolean;
|
|
rLoading: Boolean;
|
|
|
|
|
+ rOpacity: Byte;
|
|
|
|
|
|
|
|
function ApplyDimRestriction(Coords: TCoord; Direction: TDirection; Bounds: TRect; AKeepAspectRatio:Boolean): TCoord;
|
|
function ApplyDimRestriction(Coords: TCoord; Direction: TDirection; Bounds: TRect; AKeepAspectRatio:Boolean): TCoord;
|
|
|
function ApplyRatioToAxes(Coords: TCoord; Direction: TDirection; Bounds: TRect; ACropArea :TCropArea = Nil): TCoord;
|
|
function ApplyRatioToAxes(Coords: TCoord; Direction: TDirection; Bounds: TRect; ACropArea :TCropArea = Nil): TCoord;
|
|
@@ -471,6 +473,7 @@ type
|
|
|
property Empty: boolean Read getEmpty;
|
|
property Empty: boolean Read getEmpty;
|
|
|
property EmptyImage: TBGRAEmptyImage read rEmptyImage write setEmptyImage stored True;
|
|
property EmptyImage: TBGRAEmptyImage read rEmptyImage write setEmptyImage stored True;
|
|
|
property NewCropAreaDefault: TBGRANewCropAreaDefault read rNewCropAreaDefault write rNewCropAreaDefault stored True;
|
|
property NewCropAreaDefault: TBGRANewCropAreaDefault read rNewCropAreaDefault write rNewCropAreaDefault stored True;
|
|
|
|
|
+ property Opacity: Byte read rOpacity write SetOpacity default 128;
|
|
|
|
|
|
|
|
//Events
|
|
//Events
|
|
|
property OnCropAreaAdded:TCropAreaEvent read rOnCropAreaAdded write rOnCropAreaAdded;
|
|
property OnCropAreaAdded:TCropAreaEvent read rOnCropAreaAdded write rOnCropAreaAdded;
|
|
@@ -2761,6 +2764,7 @@ begin
|
|
|
|
|
|
|
|
// Create render surface
|
|
// Create render surface
|
|
|
fVirtualScreen := TBGRABitmap.Create(Width, Height);
|
|
fVirtualScreen := TBGRABitmap.Create(Width, Height);
|
|
|
|
|
+ rOpacity:= 128;
|
|
|
|
|
|
|
|
rEmptyImage :=TBGRAEmptyImage.Create(Self);
|
|
rEmptyImage :=TBGRAEmptyImage.Create(Self);
|
|
|
rNewCropAreaDefault :=TBGRANewCropAreaDefault.Create(Self);
|
|
rNewCropAreaDefault :=TBGRANewCropAreaDefault.Create(Self);
|
|
@@ -2953,7 +2957,7 @@ begin
|
|
|
|
|
|
|
|
// Render the selection background area
|
|
// Render the selection background area
|
|
|
BorderColor := BGRAWhite;
|
|
BorderColor := BGRAWhite;
|
|
|
- FillColor := BGRA(0, 0, 0, 128);
|
|
|
|
|
|
|
+ FillColor := BGRA(0, 0, 0, rOpacity);
|
|
|
Mask := TBGRABitmap.Create(WorkRect.Right - WorkRect.Left, WorkRect.Bottom - WorkRect.Top, FillColor);
|
|
Mask := TBGRABitmap.Create(WorkRect.Right - WorkRect.Left, WorkRect.Bottom - WorkRect.Top, FillColor);
|
|
|
|
|
|
|
|
if Self.Empty and rEmptyImage.ShowBorder then
|
|
if Self.Empty and rEmptyImage.ShowBorder then
|
|
@@ -3699,6 +3703,16 @@ begin
|
|
|
end;
|
|
end;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
+procedure TBGRAImageManipulation.SetOpacity(AValue: Byte);
|
|
|
|
|
+begin
|
|
|
|
|
+ if (rOpacity <> AValue) then
|
|
|
|
|
+ begin
|
|
|
|
|
+ rOpacity:= AValue;
|
|
|
|
|
+ Render;
|
|
|
|
|
+ Invalidate;
|
|
|
|
|
+ end;
|
|
|
|
|
+end;
|
|
|
|
|
+
|
|
|
procedure TBGRAImageManipulation.setSelectedCropArea(AValue: TCropArea);
|
|
procedure TBGRAImageManipulation.setSelectedCropArea(AValue: TCropArea);
|
|
|
var
|
|
var
|
|
|
oldSelected :TCropArea;
|
|
oldSelected :TCropArea;
|