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
 Jagged edges when rotate large text as overlay.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

mvbobj

USA
14 Posts

Posted - Jul 05 2016 :  09:36:19  Show Profile  Reply
I am displaying examples of specific reports and am trying to add a rotated 'stamp' of the text 'E X A M P L E' on top. I'm getting some fairly jagged results. I'm using the code:

ImageEnVect.LayersSync := True;

iLayer := ImageEnVect.LayersAdd;

ImageEnVect.Proc.Fill(TColor2TRGB(clWhite));

ImageEnVect.Proc.TextOut(Align_Text_Horz_Center, Align_Text_Vert_Center,
'E X A M P L E', 'Arial Black', 48, clBlue, [fsBold]);

ImageEnVect.Proc.SetTransparentColors(TColor2TRGB(clWhite), TColor2TRGB(clWhite), 0);

ImageEnVect.Layers[iLayer].Transparency := ATransparency;

ImageEnVect.LayersCurrent := 0;

ImageEnVect.Layers[iLayer].Rotate := 30;
ImageEnVect.Refresh;

How do I do this without the jagged edges of the rotated text?

Thanks.

xequte

38615 Posts

Posted - Jul 05 2016 :  16:46:30  Show Profile  Reply
Hi

You probably just need to apply the rotation:

http://www.imageen.com/help/TImageEnView.LayersFixRotations.html

Just ensure that you have specified a quality filter:

http://www.imageen.com/help/TImageEnView.LayersRotationFilter.html


But you should get better quality by outputing the text at an angle (rather than rotating it). See the angle parameter of:

http://www.imageen.com/help/TImageEnView.LayersCreateFromText.html

The method you use has been superceded by the LayersCreateFromText method. Can you advise its source so I can update it.



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

xequte

38615 Posts

Posted - Jul 07 2016 :  01:40:56  Show Profile  Reply
 
How do I rotate the text so that the center of the rotated text is at the center of the background layer?


You can do it as follows:

procedure Tfmain.Button7Click(Sender: TObject);
var
  iLayer: Integer;
begin
  with ImageEnView1 do
  begin
    iLayer := LayersCreateFromText('E X A M P L E', 'Arial Black', 42, clBlue, [fsBold], False, 0, 0, 0, False);
    Layers[ iLayer ].PosY := Layers[ 0 ].PosY + Layers[ 0 ].Height div 2 - Layers[ iLayer ].Height div 2;
    Layers[ iLayer ].PosX := Layers[ 0 ].PosX + Layers[ 0 ].Width div 2 - Layers[ iLayer ].Width div 2;
    Layers[iLayer].Rotate := 30;
    LayersRotationAntialias := True;
    LayersRotationFilter := ierBilinear;
    LayersFixRotations( iLayer );
  end;
end;


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

mvbobj

USA
14 Posts

Posted - Jul 07 2016 :  09:41:16  Show Profile  Reply
After rotation, the top left corner and bottom left corner of the first "E" in E X A M P L E has a few pixels shaved off - also the top right corner and bottom right corner of the last "E". This is true even if I add a space to the beginning and end of the text.

It looks like in resizing the layer to fit the rotated text, the new layer size is just a bit too small.

Is there anything that can be done about this?
Go to Top of Page

mvbobj

USA
14 Posts

Posted - Jul 07 2016 :  12:25:59  Show Profile  Reply
When using LayersCreateFromText - if I add carriage return + line feed + a second line of text - only the first line appears.

At some point I will need to apply a rotated stamp layer with the words:
"PAID"
" IN "
"FULL"
on three lines.

How would I do that?
Go to Top of Page

mvbobj

USA
14 Posts

Posted - Jul 07 2016 :  13:00:32  Show Profile  Reply
Nigel,

You asked:

"The method you use has been superceded by the LayersCreateFromText method. Can you advise its source so I can update it."

The source is:
http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=1811

Thanks,
Robert
Go to Top of Page

xequte

38615 Posts

Posted - Jul 07 2016 :  20:06:41  Show Profile  Reply
Hmmm,

The over-cropping of layer seems to be an issue in our anti-alias feature. We'll need to investigate that.

TextOut does not support multiple lines. You should have a look at the source for LayersCreateFromText(). Use that to create your own method that outputs three lines.

I would be keen to add support for multiple lines to LayersCreateFromText(), but with the coming support for native text layers in TImageEnView, I feel that would be unnecessary.



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

xequte

38615 Posts

Posted - Jul 18 2016 :  19:33:30  Show Profile  Reply
Hi

We've fixed the overcropping issue for 6.3.1, which will be released shortly.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: