TIELayerMagnification
Declaration
TIELayerMagnification = record
Enabled: boolean;
Rate: double;
Style: TIEMagnifyStyle;
Source: TIEMagnifySource;
OriginLock: TIEOriginLock;
OriginX: Integer;
OriginY: Integer;
end;
Description
Properties allowing a layer to be used for magnification.
| Field | Description | Default |
| Enabled | If true this is a magnify layer. The bitmap of the layer is filled with the background zoomed according to Rate field | False |
| Rate | The rate of the magnify layer (magnification), e.g. 10 would be 10x magnification. Value must be >1 | 2 |
| Style | The magnify layer shape | iemRectangle |
| Source | The magnify layer source | iemCanvas |
| OriginLock | Whether the OriginX/Y values are used to specify the magnification source | ieolAutoInactive |
| OriginX, OriginY | Specify the source position for the magnification (centered, in bitmap pixels), i.e. so it is not under the layer | 0,0 |
Note:
◼Magnification properties have no effect on the background layer (Layer 0), and only apply when the Magnify.Enabled = True
◼Use
ResampleFilter to specify the quality/smoothing of the magnification
Demo
| Demos\Display\Magnify2\Magnify2.dpr |
Examples
// Add a round magnification layer to the image
// Create our Magnify layer
ImageEnView1.LayersAdd( ielkImage );
magLayer := TIEImageLayer( ImageEnView1.CurrentLayer );
magLayer.Width := 200;
magLayer.Height := 200;
magLayer.VisibleBox := False; // Hide border
magLayer.Magnify.Style := iemEllipse;
magLayer.Magnify.Rate := 10; // 10x magnification
magLayer.Magnify.Source := iemBackgroundLayer;
magLayer.Magnify.Enabled := true;
magLayer.Transparency := 200; // 20% transparent
magLayer.UseResampleFilter := True;
magLayer.ResampleFilter := rfFastLinear; // Set quality
ImageEnView1.Update();
// Allow magnify layer to be moved and sized
ImageEnView1.MouseInteractLayers := [mlMoveLayers, mlResizeLayers];
// Show magnifying layer for area centered at 200,200
TIEImageLayer( ImageEnView1.CurrentLayers ).Magnify.OriginX := 200;
TIEImageLayer( ImageEnView1.CurrentLayers ).Magnify.OriginY := 200;
TIEImageLayer( ImageEnView1.CurrentLayers ).Magnify.OriginLock := ieolAlways;
ImageEnView1.Update();