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
 Draw on image in animated GIF

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
bmesser Posted - Sep 18 2022 : 10:39:53
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.
3   L A T E S T    R E P L I E S    (Newest First)
bmesser Posted - Sep 22 2022 : 11:22:26
Thanks Nigel that may be a better solution.
xequte Posted - Sep 19 2022 : 14:22:42
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
bmesser Posted - Sep 19 2022 : 06:15:54
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.