ImageEn, unit imageenview

TImageEnView.LayersFastDrawing

TImageEnView.LayersFastDrawing


Declaration

property LayersFastDrawing: TIEFastDrawing;


Description

Improves the performance of layer rendering by delayed or disabling slow operations.
Item Description
iefFast Layer draw quality is reduced to speed up display (only affects drawing)
iefDelayed Fast drawing (iefFast) is used while rotating, moving or resizing layers. After a delay, layers are then drawn at normal quality (iefNormal)
iefNormal Layers are drawn at normal quality

Configure LayerFastDrawingEffects to specify the effect of LayersFastDrawing.

Default: iefDelayed

Note: LayersFastDrawing only affects what is displayed. It has no effect on the quality of the image when saved


Layer Performance Properties

To improve the performance in layer applications, consider the following properties:
- LayersCaching: Caches the view of each layer. Much faster but uses more memory.
- LayersFastDrawing: Display quality of layers (and whether the quality view is delayed).
- LayerFastDrawingEffects specifies which features are disabled while fast drawing.
- ZoomFilter/DelayZoomFilter: Display quality of images (and whether the quality view is delayed). This option is ignored if LayersFastDrawing is active
- LayersRotationUseFilterOnPreview: Whether the quality filter (LayersRotationFilter) is previewed without applying the rotation

Review the Demos\LayerEditing\Layers_AllTypes\ demo for example code.


Examples

// Use best display quality (even when manipulating layers)
ImageEnView1.LayersFastDrawing := iefNormal;

// Use best display quality, except when manipulating layers
ImageEnView1.LayersFastDrawing := iefDelayed;

// Best performance - always display layers at lower quality
ImageEnView1.LayersFastDrawing := iefFast;

// Allow changing of preview quality via a combo-box
procedure Tfmain.cmbPreviewQualityChange(Sender: TObject);
const
 _cmbPreviewQuality_Fast = 0;
 _cmbPreviewQuality_Delayed_Best = 1;
 _cmbPreviewQuality_Best = 2;
begin
  // Separate code to make it easier to understand

  if cmbPreviewQuality.ItemIndex = _cmbPreviewQuality_Fast then
  begin
    // FASTEST DISPLAY

    // Zoom filter
    ImageEnView1.ZoomFilter := rfNone;
    ImageEnView1.DelayZoomFilter := False;

    // Rotation anti-alias
    ImageEnView1.LayersRotationFilter := ierBicubic;
    ImageEnView1.LayersRotationUseFilterOnPreview := False;

    // Fast drawing
    ImageEnView1.LayersFastDrawing := iefFast;
  end
  else
  if cmbPreviewQuality.ItemIndex = _cmbPreviewQuality_Delayed_Best then
  begin
    // DELAYED HIGH QUALITY

    // Zoom filter
    ImageEnView1.ZoomFilter := rfLanczos3;
    ImageEnView1.DelayZoomFilter := True;

    // Rotation anti-alias
    ImageEnView1.LayersRotationFilter := ierBicubic;
    ImageEnView1.LayersRotationUseFilterOnPreview := True;

    // Fast drawing
    ImageEnView1.LayersFastDrawing := iefDelayed;
  end
  else
  begin
    // HIGH QUALITY

    // Zoom filter
    ImageEnView1.ZoomFilter := rfLanczos3;
    ImageEnView1.DelayZoomFilter := False;

    // Rotation anti-alias
    ImageEnView1.LayersRotationFilter := ierBicubic;
    ImageEnView1.LayersRotationUseFilterOnPreview := True;

    // Fast drawing
    ImageEnView1.LayersFastDrawing := iefNormal;
  end;

  ImageEnView1.Update();
end;


See Also

- LayersCaching