Class TrImageZoom

Unit

Declaration

type TrImageZoom = class(TCustomControl)

Description

TCustomControl designed as replacement of standard TPicture component providing zoom and rotate function, scrollbars, drag and move support

Hierarchy

  • TCustomControl
  • TrImageZoom

Overview

Fields

Public LastFileName: string;

Methods

Public function XSrc2Pict(X: integer): integer;
Public function YSrc2Pict(Y: integer): integer;
Public function XPict2Src(X: integer): integer;
Public function YPict2Src(Y: integer): integer;
Public function Src2Pict(P: TPoint): TPoint;
Public function Pict2Src(P: TPoint): TPoint;
Public procedure Fit;
Public procedure MoveToCenter;
Public procedure SetZoomOffset(Value: TPoint);
Public procedure ZoomIn(Percent: integer = 25; Center: boolean = true);
Public procedure ZoomOut(Percent: integer = 25; Center: boolean = true);
Public function CutImageToClipboard: boolean; dynamic;
Public function CopyImageToClipboard: boolean; dynamic;
Public function PasteImageFromClipboard: boolean; dynamic;
Public function SaveAsFile(const FileName: string): boolean; dynamic;
Public function LoadFromFile(const FileName: string): boolean; dynamic;
Public function ResizePic(ratio: double): boolean; dynamic;
Public function PictureInfo: string;
Public function ShowEditorWindow: boolean; dynamic;

Properties

Public property AutoFit: boolean read GetAutoFit write SetAutoFit default false;
Published property Align;
Published property Cursor;
Published property DragCursor;
Published property DragMode;
Published property Enabled;
Published property IncrementalDisplay: boolean read FIncrementalDisplay write FIncrementalDisplay default false;
Published property ParentShowHint;
Published property Picture: TPicture read FPicture write SetPicture;
Published property PopupMenu;
Published property ShowHint;
Published property Transparent: boolean read FTransparent write SetTransparent default false;
Published property Visible;
Published property Font;
Published property ParentFont;
Published property ParentColor;
Published property ParentBackground default false;
Published property DoubleBuffered;
Published property ParentDoubleBuffered;
Published property TabStop;
Published property OnClick;
Published property OnDblClick;
Published property OnDragDrop;
Published property OnDragOver;
Published property OnEndDrag;
Published property OnMouseDown;
Published property OnMouseMove;
Published property OnMouseUp;
Published property OnStartDrag;
Published property ZoomOffset: TPoint read FZoomOffset;
Published property ScrollBar: boolean read FScrollBar write SetScrollBar default false;
Published property LockOriginalZoom: boolean read FLockOriginalZoom write SetLockOriginalZoom default false;
Published property Zoom: integer read FZoom write SetZoom default 100;
Published property EnlargeToFit: boolean read FEnlargeToFit write SetEnlargeToFit default false;
Published property ReduceToFit: boolean read FReduceToFit write SetReduceToFit default false;
Published property Stretch: boolean read FStretch write SetStretch default false;
Published property RotateType: TRotateType read FRotateType write SetRotateType default rt0;
Published property DragAndMove: boolean read FDragAndMove write FDragAndMove default true;
Published property BorderColor: TColor read FBorderColor write SetBorderColor default clWindowFrame;
Published property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clNone;
Published property BackgroundText: string read FBackgroundText write SetBackgroundText;
Published property ShowBackgroundText: boolean read FShowBackgroundText write SetShowBackgroundText default true;
Published property ShowEditor: TImageShowEditor read FShowEditor write SetShowEditor default ieShowModal;
Published property ShowPopupMenu: boolean read FShowPopupMenu write SetShowPopupMenu default true;
Published property UseFocus: boolean read FUseFocus write FUseFocus default false;
Published property SaveInJPG: boolean read FSaveInJPG write FSaveInJPG default true;
Published property OnProgress: TProgressEvent read FOnProgress write FOnProgress;
Published property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
Published property OnChangeZoom: TNotifyEvent read FOnChangeZoom write FOnChangeZoom;
Published property OnResize: TNotifyEvent read FOnResize write FOnResize;
Published property ReadOnly: boolean read FReadOnly write SetReadOnly default false;

Description

Fields

Public LastFileName: string;
 

Methods

Public function XSrc2Pict(X: integer): integer;
 
Public function YSrc2Pict(Y: integer): integer;
 
Public function XPict2Src(X: integer): integer;
 
Public function YPict2Src(Y: integer): integer;
 
Public function Src2Pict(P: TPoint): TPoint;
 
Public function Pict2Src(P: TPoint): TPoint;
 
Public procedure Fit;

change zoom of picture to fit in window

Public procedure MoveToCenter;

move selection of picture inside scroll area to center

Public procedure SetZoomOffset(Value: TPoint);

move selection of picture inside scroll area

Public procedure ZoomIn(Percent: integer = 25; Center: boolean = true);

increase zoom by selected percent

Public procedure ZoomOut(Percent: integer = 25; Center: boolean = true);

decrease zoom by selected percent

Public function CutImageToClipboard: boolean; dynamic;

cut image and insert to clipboard

Public function CopyImageToClipboard: boolean; dynamic;

copy image and insert to clipboard

Public function PasteImageFromClipboard: boolean; dynamic;

paste image from clipboard

Public function SaveAsFile(const FileName: string): boolean; dynamic;

save image to file, BMP and JPG format is supported

Public function LoadFromFile(const FileName: string): boolean; dynamic;

load image from file, BMP and JPG format is supported

Public function ResizePic(ratio: double): boolean; dynamic;

change resolution of image

Public function PictureInfo: string;

return text info with format and resolution of image

Public function ShowEditorWindow: boolean; dynamic;

show image in independent window supporting edit functions

Properties

Public property AutoFit: boolean read GetAutoFit write SetAutoFit default false;

define whether picture is automatically resized to window

Published property Align;
 
Published property Cursor;
 
Published property DragCursor;
 
Published property DragMode;
 
Published property Enabled;
 
Published property IncrementalDisplay: boolean read FIncrementalDisplay write FIncrementalDisplay default false;
 
Published property ParentShowHint;
 
Published property Picture: TPicture read FPicture write SetPicture;
 
Published property PopupMenu;
 
Published property ShowHint;
 
Published property Transparent: boolean read FTransparent write SetTransparent default false;
 
Published property Visible;
 
Published property Font;
 
Published property ParentFont;
 
Published property ParentColor;
 
Published property ParentBackground default false;
 
Published property DoubleBuffered;
 
Published property ParentDoubleBuffered;
 
Published property TabStop;
 
Published property OnClick;
 
Published property OnDblClick;
 
Published property OnDragDrop;
 
Published property OnDragOver;
 
Published property OnEndDrag;
 
Published property OnMouseDown;
 
Published property OnMouseMove;
 
Published property OnMouseUp;
 
Published property OnStartDrag;
 
Published property ZoomOffset: TPoint read FZoomOffset;
 
Published property ScrollBar: boolean read FScrollBar write SetScrollBar default false;

define whether scrollbars are visible

Published property LockOriginalZoom: boolean read FLockOriginalZoom write SetLockOriginalZoom default false;

define zoom in percent

Published property Zoom: integer read FZoom write SetZoom default 100;

define zoom in percent

Published property EnlargeToFit: boolean read FEnlargeToFit write SetEnlargeToFit default false;

define whether small picture is automatically zoomed to window

Published property ReduceToFit: boolean read FReduceToFit write SetReduceToFit default false;

define whether big picture is automatically reduced to window

Published property Stretch: boolean read FStretch write SetStretch default false;

define whether picture is automatically strech to window if AutoFit=true

Published property RotateType: TRotateType read FRotateType write SetRotateType default rt0;

define whether picture is automatically rotated

Published property DragAndMove: boolean read FDragAndMove write FDragAndMove default true;

define whether picture use drag operation to move picture

Published property BorderColor: TColor read FBorderColor write SetBorderColor default clWindowFrame;

define color of border line

Published property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default clNone;

define background color of image panel

Published property BackgroundText: string read FBackgroundText write SetBackgroundText;

define text which is shown on image panel if picture is not defined or shown

Published property ShowBackgroundText: boolean read FShowBackgroundText write SetShowBackgroundText default true;

define wether background text is shown

Published property ShowEditor: TImageShowEditor read FShowEditor write SetShowEditor default ieShowModal;

define way how the independent window is shown

Published property ShowPopupMenu: boolean read FShowPopupMenu write SetShowPopupMenu default true;

define whether internal popup menu is shown

Published property UseFocus: boolean read FUseFocus write FUseFocus default false;

define if control can have focus

Published property SaveInJPG: boolean read FSaveInJPG write FSaveInJPG default true;

define if picture is saved in JPG format

Published property OnProgress: TProgressEvent read FOnProgress write FOnProgress;
 
Published property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
 
Published property OnChangeZoom: TNotifyEvent read FOnChangeZoom write FOnChangeZoom;
 
Published property OnResize: TNotifyEvent read FOnResize write FOnResize;
 
Published property ReadOnly: boolean read FReadOnly write SetReadOnly default false;
 

Generated by PasDoc 0.15.0.