ImageEn, unit iemview

TImageEnMView.InsertTransitionFrames

TImageEnMView.InsertTransitionFrames


Declaration

procedure InsertTransitionFrames(Idx : integer; iFrameCount : integer; Effect : TIETransitionType; iWidth : Integer = -1; iHeight : Integer = -1; BackgroundColor : TColor = -1; ResamplingFilter: TResampleFilter = rfFastLinear); overload;

// Pan-Zoom overload
procedure InsertTransitionFrames(Idx : Integer; iFrameCount : Integer; Effect : TIETransitionType;
                                 StartRect, EndRect : TRect; RectMaintainAspectRatio : boolean = True;
                                 iWidth : Integer = -1; iHeight : Integer = -1; bStretchSmall : Boolean = False;
                                 BackgroundColor : TColor = -1; ResamplingFilter : TResampleFilter;
                                 Smoothing: Integer = 255; Timing : TIETransitionTiming = iettLinear); overload;


Description

Create a series of transition frames from the image at Idx - 1 to the image at Idx (and insert them at position Idx). If Idx = 0 then the transition is from a blank frame to the first image. If Idx = ImageCount then the transition is from the last image to a blank frame.
Overload 2 is primarily used when you need to create a series of frames that show a Pan-Zoom from StartRect to EndRect for the image specified at Idx - 1.

Overload 1:
Parameter Description
Idx The insertion position
iFrameCount The number of frames to insert
Effect The desired transition effect
iWidth, iHeight The size to create the transition bitmaps. If either of these are -1 then the size will be the larger of the two images in each dimension. Aspect Ratios will be maintained and any non-image area will be filled with BackgroundColor.
BackgroundColor The color that will be used for blank frames or non-image area (if -1 then Background is used)
ResamplingFilter The algorithm that is used to improve quality when resizing images

Overload 2 (Pan-Zoom effects):
Parameter Description
Idx The insertion position
iFrameCount The number of frames to insert
Effect The desired transition effect
StartRect When using an iettPanZoom effect this is the portion of the image that is shown at the start
EndRect When using an iettPanZoom effect this is the portion of the image that is shown at the end
RectMaintainAspectRatio ImageEn will ensure that the starting and ending rects are automatically adjusted to ensure the resultant image has the correct aspect ratio (iettPanZoom only)
iWidth, iHeight The size to create the transition bitmaps. If either of these are -1 then the size will be the larger of the two images in each dimension. Aspect Ratios will be maintained and any non-image area will be filled with BackgroundColor.
bStretchSmall If the images are smaller than the transition bitmap size (iWidth x iHeight) should they be stretched to fit (which can lead to distortion).
BackgroundColor The color that will be used for blank frames or non-image area (if -1 then Background is used)
ResamplingFilter The algorithm that is used to improve quality when resizing images
Smoothing In order to reduce the "jumpiness" of pan-zoom effects, transition frames can be alpha blended. A low value will improve smoothness, but increase blurriness. A high value will improve clarity, but increase jumpiness. Typical range is 64 - 196. 255 means no alpha blending (which is best when outputting to a bitmap)
Timing The rate at which the transition progresses

Notes:
- Does not call OnCreateImage
- Cannot be used if a TIEDBMultiBitmap is attached to the control


Demo

  Demos\Multi\CreateTransitionFrames\CreateTransitionFrames.dpr


Examples

// Create ten frames that use a cross dissolve transition from image 5 to image 6
ImageEnMView1.InsertTransitionFrames(6, 10, iettCrossDissolve);


// Create ten Pan-Zoom frames for the image at index 5

// Top Left corner of image
StartingRect := Rect(0, 0, ImageEnMView1.ImageWidth[5] div 4, ImageEnMView1.ImageHeight[5] div 4);

// Bottom right corner of image
EndingRect := Rect(MulDiv(ImageEnMView1.ImageWidth[5], 3, 4), MulDiv(ImageEnMView1.ImageHeight[5], 3, 4), ImageEnMView1.ImageWidth[5], ImageEnMView1.ImageHeight[5]);

// Create frames
ImageEnMView1.InsertTransitionFrames(5, 10, iettPanZoom, StartRect, EndRect);