ImageEn, unit imageenproc

TImageEnProc.CreateTransitionBitmap

TImageEnProc.CreateTransitionBitmap


Declaration

procedure CreateTransitionBitmap(TransitionProgress : Single; DestBitmap : TIEBitmap); overload;
procedure CreateTransitionBitmap(TransitionProgress : Single; DestBitmap : TBitmap); overload;


Description

Use with PrepareTransitionBitmaps to create a series of frames that transition from one bitmap to another.

Parameter Description
TransitionProgress The percentage that it is has progressed from the start image to the end image (ranging from 0.0 to 100.0)
DestBitmap Will be filled with the created transition frame. It must be created before calling and will be automatically sized and set to 24 bit


Demo

Demo  Demos\Multi\CreateTransitionFrames\CreateTransitionFrames.dpr


Example

procedure TransitionFrameCreationExample;
var
  OldBitmap, NewBitmap, TransBitmap : TBitmap;
  I : Integer;
  TransLevel : Single;
begin
  OldBitmap := TBitmap.Create;
  NewBitmap := TBitmap.Create;
  TransBitmap := TBitmap.Create;
  try
    OldBitmap.LoadFromFile('C:\OldImage.bmp');
    NewBitmap.LoadFromFile('C:\NewImage.bmp');

    // Call PrepareTransitionBitmaps once
    ImageEnProc.PrepareTransitionBitmaps(OldBitmap, NewBitmap, iettCrossDissolve);

    for i := 1 to 9 do
    begin
      // Transition levels from 10% to 90%
      TransLevel := i * 10;
      
      // Call CreateTransitionBitmap for each required frame
      ImageEnProc.CreateTransitionBitmap(TransLevel, TransBitmap);
      TransBitmap.SaveToFile('C:\TransImage' + IntToStr(I) + '.bmp');
    end;
  finally
    OldBitmap.Free;
    NewBitmap.Free;
    TransBitmap.Free;
  end;
end;


See Also

- PrepareTransitionBitmaps