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
 Capturing transitions frame by frame
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

keithml

USA
18 Posts

Posted - Feb 01 2013 :  08:06:45  Show Profile  Reply
Is there a way to capture the images produced by transitions at given intervals? For instance, get a snapshot of the image 20% into a transition.

To illustrate what I am asking how to do, it would be in the form of a function like:

RenderTransitionFrame(Effect:TIETransitionType;TimeElapsed,Duration:integer);

Thanks,
Keith

xequte

38611 Posts

Posted - Feb 01 2013 :  11:36:41  Show Profile  Reply
Hi Keith

Yes, see:

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

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;



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

keithml

USA
18 Posts

Posted - Feb 01 2013 :  12:07:00  Show Profile  Reply
Thanks for the quick reply. That should work. It would be nicer if it were handled at the TImageEnView level instead of with TBitmaps, but that is not a big deal.

Keith
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: