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
 Transition between two bitmaps
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

DDWDK

Denmark
3 Posts

Posted - Apr 22 2019 :  09:53:25  Show Profile  Reply
Hi support,

First let me thank you for creating such an amazing product, it's really a joy to work with.

I am currently trying to make a transition between two bitmaps which are loaded into memory.

//No 1 bitmap
bmp1->Assign(ImageENView1->IO->IEBitmap);

//No 2 bitmap
bmp2->Brush->Color = RGB(255,255,255)
bmp2->Width = ImageENView1->IO->IEBitmap->Width;
bmp2->Height = ImageENView1->IO->IEBitmap->Height;

I want the images to fade in or out, but as I read the help manual it can only be done using LoadFromFile (though I am guessing the LoadFromFile loads the image into a bitmap memory buffer).

I have also tried to read the LoadFromBuffer in the help manual, but I am stuck

Can it be done? and if so, I would really appreciate you share how it can be done

Many thanks for your help, and have a great day.

zerob

111 Posts

Posted - Apr 22 2019 :  11:21:30  Show Profile  Reply
You could also use layers for both images and use their opacity to fade in and out.
Go to Top of Page

DDWDK

Denmark
3 Posts

Posted - Apr 22 2019 :  16:44:24  Show Profile  Reply
Very good point zerob, thanks for pointing me in the right direction. I'll have a look at it :-)
Go to Top of Page

xequte

38180 Posts

Posted - Apr 22 2019 :  17:27:24  Show Profile  Reply
Hi

You can also use the built in transition effects:

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

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.imageen.com
Go to Top of Page

DDWDK

Denmark
3 Posts

Posted - Apr 24 2019 :  16:48:48  Show Profile  Reply
Thanks a lot for adding this Nigel, truly appreciated. Just what I was looking for to manage it in memory.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: