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
 Draw on image in animated GIF
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

bmesser

United Kingdom
221 Posts

Posted - Sep 18 2022 :  10:39:53  Show Profile  Reply
Hi

I'm creating an animated GIF and I want to add a date label to the image.

I realise you can achieve this with bottomtext or infotext but I want to draw inside the image.

I've tried the OnImageDraw and OnImageOut events without any luck with this code.

procedure TfmMain.ImageImageOut(Sender: TObject; idx: Integer; OutBitmap: TIEBitmap);
var
  str : string;
begin
  with OutBitMap.Canvas do
  begin
    Brush.Style:=bsClear;
    Font.Size:=10;
    Font.Name:='Cascadia Mono';
    Font.Color:=clBlack;

    str:=FormatDateTime('MMMM YYYY',IncMonth(Fsdt,idx));
    TextOut((OutBitmap.Width-TextWidth(str)) div 2,OutBitmap.Height-TextHeight(str)-2,str);
  end;
end;


Although the text is visible on screen it isn't in the animation.

Is there another event I should be using?

Bruce.

bmesser

United Kingdom
221 Posts

Posted - Sep 19 2022 :  06:15:54  Show Profile  Reply
I've got around this problem by using a dynamic TImageEnView (img) and opening the image in that before writing to it's bitmap.
I then use the Image.AppendImage(img) method to add the image to the TImageEnMView component.
Go to Top of Page

xequte

7215 Posts

Posted - Sep 19 2022 :  14:22:42  Show Profile  Reply
Hi Bruce

You can also iterate through all the images in the TImageEnMView and draw using ImageEnMView1.Proc.DrawText. There is an example at:

http://www.imageen.com/help/TImageEnMView.Proc.html




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

bmesser

United Kingdom
221 Posts

Posted - Sep 22 2022 :  11:22:26  Show Profile  Reply
Thanks Nigel that may be a better solution.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: