📄 imageenview.pas
字号:
<FM>Properties and Fields<FN>
<A TIELayer.Bitmap>
<A TIELayer.Visible>
<A TIELayer.VisibleBox>
<A TIELayer.Transparency>
<A TIELayer.PosX>
<A TIELayer.PosY>
<A TIELayer.ClientAreaBox>
<A TIELayer.Cropped>
<A TIELayer.Locked>
<A TIELayer.Selectable>
<A TIELayer.Magnify>
<A TIELayer.Operation>
<A TIELayer.UserData>
<A TIELayer.UserDataLen>
<A TIELayer.ResampleFilter>
<A TIELayer.UseResampleFilter>
<A TIELayer.Name>
<A TIELayer.IsMask>
<A TIELayer.DrawingInfo>
<A TIELayer.DrawOuter>
<A TIELayer.Width>
<A TIELayer.Height>
!!}
TIELayer = class
private
ResizedWidth, ResizedHeight: integer; // 0=original sizes
function GetWidth: integer;
function GetHeight: integer;
public
fOwner:TObject; // must be TImageEnView
{!!
<FS>TIELayer.Bitmap
<FM>Declaration<FC>
property Bitmap:<A TIEBitmap>;
<FM>Description<FN>
Contains the image and alpha channel of the layer.
!!}
Bitmap: TIEBitmap;
{!!
<FS>TIELayer.Visible
<FM>Declaration<FC>
property Visible:boolean;
<FM>Description<FN>
Set to True to make the layer visible, otherwise set to False to hide it.
!!}
Visible: boolean; // if True the layer is visible
{!!
<FS>TIELayer.VisibleBox
<FM>Declaration<FC>
property VisibleBox: boolean;
<FM>Description<FN>
If True, a box around the layer will be displayed.
!!}
VisibleBox: boolean;
{!!
<FS>TIELayer.Transparency
<FM>Declaration<FC>
property Transparency:integer;
<FM>Description<FN>
Allows to set the overall transparency of the layer (255=opaque..0=transparent)
!!}
Transparency: integer; // 255=opaque 0=transparency
{!!
<FS>TIELayer.PosX
<FM>Declaration<FC>
property PosX:integer;
<FM>Description<FN>
Specifies the relative (to the layer 0 - background image) position of the layer. Valid only when <A TImageEnView.LayersSync>=False.
!!}
PosX: integer;
{!!
<FS>TIELayer.PosY
<FM>Declaration<FC>
property PosY:integer;
<FM>Description<FN>
Specifies the relative (to the layer 0 - background image) position of the layer. Valid only when <A TImageEnView.LayersSync>=False.
!!}
PosY: integer;
{!!
<FS>TIELayer.ClientAreaBox
<FM>Declaration<FC>
property ClientAreaBox:TRect;
<FM>Description<FN>
This is a read-only property which will contains where ImageEn drawn the layer.
The coordinates are relative to the component client area. Valid only if <A TImageEnView.LayersSync>=False.
!!}
ClientAreaBox: TRect;
{!!
<FS>TIELayer.Cropped
<FM>Declaration<FC>
property Cropped:boolean;
<FM>Description<FN>
If true and the layer is out of background image (layer 0) area, this layer will be cut to the background.
Valid only if <A TImageenView.LayersSync>=False.
!!}
Cropped: boolean;
{!!
<FS>TIELayer.Locked
<FM>Declaration<FC>
property Locked:boolean;
<FM>Description<FN>
If False user can move or resize the layer. Also this enables to show the layer border and resizing grips.
Valid only if <A TImageEnView.LayersSync>=False.
!!}
Locked: boolean;
{!!
<FS>TIELayer.Selectable
<FM>Declaration<FC>
property Selectable: boolean;
<FM>Description<FN>
If true (default) the layer is selectable by user action.
!!}
Selectable: boolean;
{!!
<FS>TIELayer.Magnify
<FM>Declaration<FC>
property Magnify: <A TIELayerMagnification>
<FM>Description<FN>
Sets properties when the layer is a magnification layer.
!!}
Magnify: TIELayerMagnification;
{!!
<FS>TIELayer.Operation
<FM>Declaration<FC>
property Operation: <A TIERenderOperation>;
<FM>Description<FN>
Specifies the operation to execute between this layer and the background layer.
!!}
Operation: TIERenderOperation;
{!!
<FS>TIELayer.UserData
<FM>Declaration<FC>
property UserData: pointer;
<FM>Description<FN>
Contains a pointer to user data buffer. Look also <A TIELayer.UserDataLen>.
!!}
UserData: pointer;
{!!
<FS>TIELayer.UserDataLen
<FM>Declaration<FC>
property UserDataLen:integer;
<FM>Description<FN>
Specifies the length of UserData buffer.
If this value is >0 then when you save the layer (LayersSaveTo..) the content of <A TIELayer.UserData> buffer is saved (and restored with LayersLoadFrom..).
!!}
UserDataLen:integer; // used when save. If >0 then saves UserData content. Also it UserData will be freed on destroy
FreeBitmapOnDestroy: boolean;
{!!
<FS>TIELayer.ResampleFilter
<FM>Declaration<FC>
property ResampleFilter: <A TResampleFilter>;
<FM>Description<FN>
Actived only when <A TIELayer.UseResampleFilter> is true this property specifies a resample filter to use instead of default one (<A TImageEnView.ZoomFilter>).
!!}
ResampleFilter:TResampleFilter;
{!!
<FS>TIELayer.UseResampleFilter
<FM>Declaration<FC>
property UseResampleFilter: boolean;
<FM>Description<FN>
This property active the value specified in <A TIELayer.ResampleFilter>.
!!}
UseResampleFilter:boolean; // if true uses this ResampleFilter instead of TImageEnView.ZoomFilter
{!!
<FS>TIELayer.Name
<FM>Declaration<FC>
property Name:string;
<FM>Description<FN>
Contains the layer name. Only applications use this field.
!!}
Name:string;
{!!
<FS>TIELayer.IsMask
<FM>Declaration<FC>
property IsMask:boolean;
<FM>Description<FN>
If True this is a layer mask. A layer mask contains a gray scale image (ie8g) which is connected to the upper layer.
The layer mask specifies where the upper layer is visible (255=fully visible).
A layer mask should be invisible (<A TIELayer.Visible>=False).
!!}
IsMask:boolean; // This is the "layer mask" of previous layer
{!!
<FS>TIELayer.DrawingInfo
<FM>Declaration<FC>
property DrawingInfo:<A TIEDrawingInfo>;
<FM>Description<FN>
Specifies the source and destination rectangle recorded on last drawing.
!!}
DrawingInfo:TIEDrawingInfo; // filled by PaintToEx
{!!
<FS>TIELayer.DrawOuter
<FM>Declaration<FC>
property DrawOuter:boolean;
<FM>Description<FN>
If True draws unselected layers as 'grayed'. The selected layer is drawn normally.
!!}
DrawOuter:boolean;
{!!
<FS>TIELayer.Width
<FM>Declaration<FC>
property Width:integer;
<FM>Description<FN>
Specifies the layer size (in bitmap sizes). Valid only if <A TImageEnView.LayersSync>=False.
!!}
property Width: integer read GetWidth write ResizedWidth; // displayed width of the layer
{!!
<FS>TIELayer.Height
<FM>Declaration<FC>
property Height:integer;
<FM>Description<FN>
Specifies the layer size (in bitmap sizes). Valid only if <A TImageEnView.LayersSync>=False.
!!}
property Height: integer read GetHeight write ResizedHeight; // displayed height of the layer
constructor Create(Owner:TObject; TemplateBitmap: TIEBitmap; JustAssign: boolean);
destructor Destroy; override;
function ConvXScr2Bmp(x:integer):integer;
function ConvYScr2Bmp(y:integer):integer;
function ConvXBmp2Scr(x:integer):integer;
function ConvYBmp2Scr(y:integer):integer;
procedure Assign(Source:TIELayer);
procedure SetDefaults;
end;
{!!
<FS>TIELayerEvent
<FM>Declaration<FC>
TIELayerEvent = (ielSelected, ielMoved, ielResized, ielMoving, ielResizing);
<FM>Description<FN>
<TABLE>
<R> <H>Value</H> <H>Description</H> </R>
<R> <C>ielSelected</C> <C>user selected the layer</C> </R>
<R> <C>ielMoved</C> <C>user moved the layer</C> </R>
<R> <C>ielResized</C> <C>user resized the layer</C> </R>
<R> <C>ielMoving</C> <C>user is moving the layer</C> </R>
<R> <C>ielResizing</C> <C>user is resizing the layer</C> </R>
</TABLE>
!!}
TIELayerEvent = (ielSelected, ielMoved, ielResized, ielMoving, ielResizing);
{!!
<FS>TIELayerNotify
<FM>Declaration<FC>
TIELayerNotify = procedure(Sender: TObject; layer: integer; event: <A TIELayerEvent>) of object;
<FM>Description<FN>
<FC>layer<FN> is the layer index that is selected, moved or resized.
<FC>event<FN> specifies the event type.
!!}
TIELayerNotify = procedure(Sender: TObject; layer: integer; event: TIELayerEvent) of object;
{!!
<FS>TIERSOptions
<FM>Declaration<FC>
TIERSOptions = (iersNone, iersMoveToAdapt, iersSyncLayers);
<FM>Description<FN>
<TABLE>
<R> <H>Value</H> <H>Description</H> </R>
<R> <C>iersNone</C> <C>no adaption</C> </R>
<R> <C>iersMoveToAdapt</C> <C>move the selection to fit inside the new size</C> </R>
<R> <C>iersSyncLayers</C> <C>used to maintain the selection in the same position among layers</C> </R>
</TABLE>
!!}
TIERSOptions = (iersNone, iersMoveToAdapt, iersSyncLayers);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TImageEnView
{!!
<FS>TImageEnView
<FM>Description<FN>
TImageEnView is an image container and viewer. TImageEnView allows zoom, scroll and can handle multiple layers.
TImageEnView encapsulates a <A TImageEnIO> (<A TImageEnView.IO> property) and a <A TImageEnProc> (<A TImageEnView.Proc> property) component, to allow input/output and image processing tasks without adding TImageEnIO and TImageEnProc components.
<FM>Properties<FN>
<FI>Alpha channel<FN>
<A TImageEnView.AlphaChannel>
<A TImageEnView.EnableAlphaChannel>
<A TImageEnView.HasAlphaChannel>
<FI>Display<FN>
<A TImageEnView.Center>
<A TImageEnView.OffsetX>
<A TImageEnView.OffsetY>
<A TImageEnView.ViewX>
<A TImageEnView.ViewY>
<A TImageEnView.AutoShrink>
<A TImageEnView.AutoStretch>
<A TImageEnView.ExtentX>
<A TImageEnView.ExtentY>
<A TImageEnView.IdealComponentHeight>
<A TImageEnView.IdealComponentWidth>
<A TImageEnView.OffScreenPaint>
<A TImageEnView.ZoomFilter>
<A TImageEnView.Zoom>
<A TImageEnView.ZoomX>
<A TImageEnView.ZoomY>
<FI>Others<FN>
<A TImageEnView.BackBuffer>
<A TImageEnView.DelayTimer>
<A TImageEnView.DelayZoomFilter>
<A TImageEnView.DelayZoomTime>
<A TImageEnView.DisplayGrid>
<A TImageEnView.DoubleBuffer>
<A TImageEnView.DrawVersion>
<A TImageEnView.LockPaintCount>
<FI>Background<FN>
<A TImageEnView.BackgroundStyle>
<A TImageEnView.Background>
<A TImageEnView.GradientEndColor>
<A TImageEnView.WallPaperStyle>
<A TImageEnView.WallPaper>
<FI>Cursor<FN>
<A TImageEnView.AutoCursors>
<FI>Bitmap<FN>
<A TImageEnView.Bitmap>
<A TIEView.DpiX>
<A TIEView.DpiY>
<A TImageEnView.IEBitmap>
<A TImageEnView.IsEmpty>
<A TImageEnView.LegacyBitmap>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -