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
 BottomText when appending Bitmap to TImageEnMView?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

859 Posts

Posted - Jan 19 2021 :  15:36:43  Show Profile  Reply
In a TImageEnMView I add images with:

ImageEnMView1.AppendImage(ABitmap);


I need to add a different BottomText to each image. This BottomText is available only when using AppendImage. It is NOT available in the TImageEnMView.OnGetText event-handler.

So, is there a way to add BottomText when adding the images with ImageEnMView1.AppendImage(ABitmap)?

Reading the documentation, unfortunately there is no such an overload:

ImageEnMView1.AppendImage(ABitmap, ABottomText);

PeterPanino

859 Posts

Posted - Jan 20 2021 :  06:10:54  Show Profile  Reply
I have solved the problem by adding the Bottom Text to a StringList when appending the Bitmaps and then adding the Bottom Text from that StringList in the OnGetText event-handler:

procedure TformCustomClipartsListsManager.ImageEnMViewSVGCollectionGetText(Sender: TObject; Index: Integer; Position: TIEMTextPos; var Text: WideString);
begin
  if Position = iemtpInfo then
    Text := SLBottomText[Index];
end;


But this adds unnecessary complexity to the implementation and thus is error-prone. So I suggest you implement this additional overload:

function TImageEnMView.AppendImage(Bitmap : TBitmap; ATopText, AInfoText, ABottomText: string): integer;
Go to Top of Page

xequte

38176 Posts

Posted - Jan 20 2021 :  22:23:39  Show Profile  Reply
Hi Peter

You can use:

idx := ImageEnMView1.AppendImage( 'D:\Butterfly.jpg' );
ImageEnMView1.ImageTopText[idx]    := 'Top text';
ImageEnMView1.ImageInfoText[idx]   := 'Info text';
ImageEnMView1.ImageBottomText[idx] := 'Bottom text';


Also, for bottom text you should use iemtpBottom in the OnGetText event.

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

PeterPanino

859 Posts

Posted - Jan 21 2021 :  17:51:57  Show Profile  Reply
Hi Nigel,

as always, your solutions are BRILLIANT! Thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: