ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Export transition to avi?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yeohray2

Malaysia
104 Posts

Posted - Sep 10 2024 :  09:19:36  Show Profile  Reply
I'm current using the cross-dissolve transition to show one image merging into another. Is it possible to export the transition from image 1 to image 2 to an avi file?

Thank you.

Regards
Ray

xequte

38531 Posts

Posted - Sep 11 2024 :  01:01:28  Show Profile  Reply
Hi Ray

Yes, you would need to use CreateTransitionBitmap to generate your transition bitmaps:

http://www.imageen.com/help/TImageEnProc.CreateTransitionBitmap.html

And add them to an AVI using:

https://www.imageen.com/help/TImageEnIO.SaveToAVI.html


const
  Frames_Per_Second = 20;
  Display_Seconds   = 5;
var
  proc: TImageEnProc;
  io: TImageEnIO;
  startBitmap, endBitmap : TIEBitmap;
  i, frameCount: Integer;
  transLevel: Single;
begin
  startBitmap := TIEBitmap.Create;
  endBitmap   := TIEBitmap.Create;

  proc := TImageEnProc.Create( nil );
  io   := TImageEnIO.Create( nil );
  try
    if io.CreateAVIFile('D:\Transition.avi', Frames_Per_Second, 'cvid' ) = ieaviNOCOMPRESSOR then
      raise Exception.create( 'This compressor is unavailable!' );

    startBitmap.LoadFromFile( 'D:\image1.jpg' );
    endBitmap.LoadFromFile( 'D:\image2.jpg' );

    // Call PrepareTransitionBitmaps once
    proc.PrepareTransitionBitmaps(startBitmap, endBitmap, SelectedTransitionEffect);

    frameCount := Display_Seconds * Frames_Per_Second;

    for i := 0 to frameCount - 1 do
    begin
      // We want levels from 0% to 100% (show start and end)
      transLevel := 100 / ( frameCount - 1 ) * i;

      // Call CreateTransitionBitmap for each required frame
      proc.CreateTransitionBitmap( transLevel, io.IEBitmap );
      io.SaveToAVI();

      Caption := IntToStr( Round( i / frameCount * 100 )) + '%';
    end;

    io.CloseAVIFile();
    Caption := 'Done!';

  finally
    startBitmap.Free();
    endBitmap.Free();
    proc.Free();
    io.Free();
  end;
end;



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

38531 Posts

Posted - Sep 11 2024 :  02:16:15  Show Profile  Reply
Also see the demo:

\Demos\Multi\CreateTransitionFrames\CreateTransitionFrames.dpr

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yeohray2

Malaysia
104 Posts

Posted - Sep 11 2024 :  04:10:20  Show Profile  Reply
Thank you very much for the help, Nigel.

Ray
Go to Top of Page

xequte

38531 Posts

Posted - Sep 11 2024 :  17:00:54  Show Profile  Reply
You should also email me for the latest beta, which has a small improvement to transition bitmap exporting.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: