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
 Add a caption to the image?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

982 Posts

Posted - Aug 25 2017 :  20:02:39  Show Profile  Reply
Is there a ready-made simple TImageEnView method to automatically create a CAPTION for an image to get something like this:



Example:
ImageEnView1.AddCaption(CaptionText, ImagePosition, TextAlignment, BackgroundColor, TextColor, Fontname, FontStyle, etc.);

w2m

USA
1990 Posts

Posted - Aug 26 2017 :  11:46:36  Show Profile  Reply
procedure TForm1.AddText1Click(Sender: TObject);
var
  iText: string;
begin
  Screen.Cursor := crHourGlass;
  try
    ImageEnView1.DeSelect;
    ImageEnView1.LayersAdd(ielkText);
    iText := 'Natural Flower';
    TIETextLayer(ImageEnView1.CurrentLayer).Text := iText;
    TIETextLayer(ImageEnView1.CurrentLayer).FillColor := clWebGold;
    TIETextLayer(ImageEnView1.CurrentLayer).Font.Name := 'Arial';
    TIETextLayer(ImageEnView1.CurrentLayer).Font.Size := 10;
    TIETextLayer(ImageEnView1.CurrentLayer).Font.Color := clBlack;
    TIETextLayer(ImageEnView1.CurrentLayer).Font.Style  := [fsBold];
    ImageEnView1.CurrentLayer.PosX := -1;
    ImageEnView1.CurrentLayer.PosY := ImageEnView1.Layers[0].Height;
    ImageEnView1.CurrentLayer.Width := ImageEnView1.Layers[0].Width+1;
    ImageEnView1.CurrentLayer.Height := ImageEnView1.IEBitmap.IECanvas.TextHeight(iText) +  16;
    TIETextLayer(ImageEnView1.CurrentLayer).Alignment := iejCenter;
    TIETextLayer(ImageEnView1.CurrentLayer).Layout := ielCenter;
    ImageEnView1.Update;
    ImageEnView1.LayersMergeAll;
    ImageEnView1.Zoom := 100;
  finally
    Screen.Cursor := crDefault;
  end;
end;



Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39053 Posts

Posted - Aug 28 2017 :  22:56:28  Show Profile  Reply
Nice demo!

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

PeterPanino

982 Posts

Posted - Sep 10 2017 :  09:00:21  Show Profile  Reply
Bill, thank you very much!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: