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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Transition between two bitmaps

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
DDWDK Posted - Apr 22 2019 : 09:53:25
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.
4   L A T E S T    R E P L I E S    (Newest First)
DDWDK Posted - Apr 24 2019 : 16:48:48
Thanks a lot for adding this Nigel, truly appreciated. Just what I was looking for to manage it in memory.
xequte Posted - Apr 22 2019 : 17:27:24
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
DDWDK Posted - Apr 22 2019 : 16:44:24
Very good point zerob, thanks for pointing me in the right direction. I'll have a look at it :-)
zerob Posted - Apr 22 2019 : 11:21:30
You could also use layers for both images and use their opacity to fade in and out.