|
@@ -39,6 +39,7 @@ type
|
|
TLazPaintImage = class
|
|
TLazPaintImage = class
|
|
private
|
|
private
|
|
FLazPaintInstance: TObject;
|
|
FLazPaintInstance: TObject;
|
|
|
|
+ FZoom: TZoom;
|
|
FActionInProgress: TCustomLayerAction;
|
|
FActionInProgress: TCustomLayerAction;
|
|
FOnActionProgress: TLayeredActionProgressEvent;
|
|
FOnActionProgress: TLayeredActionProgressEvent;
|
|
FOnSelectedLayerIndexChanging: TOnCurrentLayerIndexChanged;
|
|
FOnSelectedLayerIndexChanging: TOnCurrentLayerIndexChanged;
|
|
@@ -126,6 +127,7 @@ type
|
|
procedure SetOnActionProgress(AValue: TLayeredActionProgressEvent);
|
|
procedure SetOnActionProgress(AValue: TLayeredActionProgressEvent);
|
|
procedure SetOnSizeChanged(AValue: TNotifyEvent);
|
|
procedure SetOnSizeChanged(AValue: TNotifyEvent);
|
|
procedure SetSelectionTransform(ATransform: TAffineMatrix);
|
|
procedure SetSelectionTransform(ATransform: TAffineMatrix);
|
|
|
|
+ procedure SetZoom(AValue: TZoom);
|
|
procedure UpdateIconFileUTF8(AFilename: string; AOutputFilename: string = ''; AExport: boolean = false);
|
|
procedure UpdateIconFileUTF8(AFilename: string; AOutputFilename: string = ''; AExport: boolean = false);
|
|
procedure UpdateTiffFileUTF8(AFilename: string; AOutputFilename: string = ''; AExport: boolean = false);
|
|
procedure UpdateTiffFileUTF8(AFilename: string; AOutputFilename: string = ''; AExport: boolean = false);
|
|
procedure UpdateGifFileUTF8(AFilename: string; AOutputFilename: string = ''; AExport: boolean = false);
|
|
procedure UpdateGifFileUTF8(AFilename: string; AOutputFilename: string = ''; AExport: boolean = false);
|
|
@@ -133,10 +135,10 @@ type
|
|
procedure LayerActionNotifyChange({%H-}ASender: TObject; ALayer: TBGRABitmap; ARect: TRect);
|
|
procedure LayerActionNotifyChange({%H-}ASender: TObject; ALayer: TBGRABitmap; ARect: TRect);
|
|
procedure LayerActionDestroy(Sender: TObject);
|
|
procedure LayerActionDestroy(Sender: TObject);
|
|
procedure LayerActionNotifyUndo({%H-}ASender: TObject; AUndo: TCustomImageDifference; var Owned: boolean);
|
|
procedure LayerActionNotifyUndo({%H-}ASender: TObject; AUndo: TCustomImageDifference; var Owned: boolean);
|
|
|
|
+ procedure ZoomOnCenterQuery(Sender: TObject);
|
|
public
|
|
public
|
|
OnException: TImageExceptionHandler;
|
|
OnException: TImageExceptionHandler;
|
|
ImageOffset: TPoint;
|
|
ImageOffset: TPoint;
|
|
- Zoom: TZoom;
|
|
|
|
CursorHotSpot: TPoint;
|
|
CursorHotSpot: TPoint;
|
|
BPP, FrameIndex, FrameCount: integer;
|
|
BPP, FrameIndex, FrameCount: integer;
|
|
VisibleArea: TRectF;
|
|
VisibleArea: TRectF;
|
|
@@ -298,6 +300,7 @@ type
|
|
property RenderUpdateRectInPicCoord: TRect read FRenderUpdateRectInPicCoord;
|
|
property RenderUpdateRectInPicCoord: TRect read FRenderUpdateRectInPicCoord;
|
|
property RenderUpdateRectInVSCoord: TRect read FRenderUpdateRectInVSCoord;
|
|
property RenderUpdateRectInVSCoord: TRect read FRenderUpdateRectInVSCoord;
|
|
property SelectionTransform: TAffineMatrix read GetSelectionTransform write SetSelectionTransform;
|
|
property SelectionTransform: TAffineMatrix read GetSelectionTransform write SetSelectionTransform;
|
|
|
|
+ property Zoom: TZoom read FZoom write SetZoom;
|
|
property ZoomFactor: single read GetZoomFactor;
|
|
property ZoomFactor: single read GetZoomFactor;
|
|
property DraftOriginal: boolean read FDraftOriginal write SetDraftOriginal;
|
|
property DraftOriginal: boolean read FDraftOriginal write SetDraftOriginal;
|
|
property IsIconCursor: boolean read GetIsIconCursor;
|
|
property IsIconCursor: boolean read GetIsIconCursor;
|
|
@@ -352,6 +355,11 @@ begin
|
|
OnImageChanged.NotifyObservers;
|
|
OnImageChanged.NotifyObservers;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TLazPaintImage.ZoomOnCenterQuery(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ ImageOffset := Point(0,0);
|
|
|
|
+end;
|
|
|
|
+
|
|
function TLazPaintImage.MakeCroppedLayer: TBGRABitmap;
|
|
function TLazPaintImage.MakeCroppedLayer: TBGRABitmap;
|
|
var r: TRect;
|
|
var r: TRect;
|
|
cropped: TBGRABitmap;
|
|
cropped: TBGRABitmap;
|
|
@@ -964,6 +972,14 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TLazPaintImage.SetZoom(AValue: TZoom);
|
|
|
|
+begin
|
|
|
|
+ if FZoom=AValue then Exit;
|
|
|
|
+ if Assigned(FZoom) then FZoom.OnCenterQuery:= nil;
|
|
|
|
+ FZoom:=AValue;
|
|
|
|
+ if Assigned(FZoom) then FZoom.OnCenterQuery:=@ZoomOnCenterQuery;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TLazPaintImage.SetLayerName(AIndex: integer; AValue: string);
|
|
procedure TLazPaintImage.SetLayerName(AIndex: integer; AValue: string);
|
|
begin
|
|
begin
|
|
AddUndo(FCurrentState.SetLayerName(AIndex,Avalue));
|
|
AddUndo(FCurrentState.SetLayerName(AIndex,Avalue));
|