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
 Font border autosize
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Alexa

Russia
6 Posts

Posted - Jun 15 2013 :  14:41:31  Show Profile  Reply
Hello,

I tried to set Text in TImageEnView1

But I don't know how to setup border equal to the size of the Text

Procedure is included. See att

procedure Tfmain.Button1Click(Sender: TObject);
begin
ImageEnView1.LayersAdd; // add a new layer
// ImageEnView1.Proc.Fill(CreateRGB(255,255,255));
ImageEnView1.Proc.Fill(CreateRGB(255,255,255));
ImageEnView1.Bitmap.Canvas.Font.Name := 'Times New Roman';
ImageEnView1.Bitmap.Canvas.Font.Height := 50;
ImageEnView1.Bitmap.Canvas.Font.Color := clYellow;
// IETextOut(ImageEnView1.Bitmap.Canvas, (ImageEnView1.Width div 2) - 100, ImageEnView1.Height div 2, 0, 'Hello World!'); // draw text on second layer
IETextOut(ImageEnView1.Bitmap.Canvas, 0, 0, 0, 'Hello World!'); // draw text on second layer
ImageEnView1.Proc.SetTransparentColors(CreateRGB(255, 255, 255), CreateRGB(255,255, 255), 0); // remove the white, making it as transparent
ImageEnView1.Proc.AddSoftShadow(2, 3, 3); // add the shadow
RefreshControls;
RefreshLayerViewer;
end;




Alex

klausdoege

Germany
389 Posts

Posted - Jun 16 2013 :  01:46:24  Show Profile  Reply
Hello,
try this.
ImageEnView1.Iebitmap.Width:=ImageEnView1.Iebitmap.Canvas.TextWidth(your_text);
and
ImageEnView1.Iebitmap.height:=ImageEnView1.ieBitmap.Canvas.TextHeight(your_text);

Klaus
www.klausdoege.de
Go to Top of Page

Alexa

Russia
6 Posts

Posted - Jun 16 2013 :  14:12:45  Show Profile  Reply
Fine!!!

Thanks! It works!


Alex
Go to Top of Page

Alexa

Russia
6 Posts

Posted - Jun 16 2013 :  14:30:27  Show Profile  Reply
Klaus

I looked your site and picture with birds and eclipsed text (textebene jetzt neu!)

Is it standart function of ImageEnView?

How is made?



Alex
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: