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
 iejRight and right aligned text
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yeohray2

Malaysia
106 Posts

Posted - Dec 09 2020 :  02:42:19  Show Profile  Reply
When using a text layer with multiple lines of text and Alignment := iejRight, only the longest line is right aligned. All other lines start on the same x position as the longest line e.g.



instead of ending on the right. How can I get the text to align on the right margin this way?



Thank you.

xequte

38610 Posts

Posted - Dec 09 2020 :  16:30:01  Show Profile  Reply
Hi

Unformatted text in TIETextLayer does not support text line-by-line alignment. You will need to enable formatting:

https://www.imageen.com/help/TIETextLayer.EnableFormatting.html

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

yeohray2

Malaysia
106 Posts

Posted - Dec 10 2020 :  10:51:53  Show Profile  Reply
Got it, thanks. However, I ran into another issue.

Using the rich edit formatting to set my font to white, the text appears fine when running using the Windows theme. However, when switching to the Carbon theme, the text is a dark-grayish color - the font color in the rich edit formatting is ignored.

Code to create the text is like this:

procedure TestLayer;
var
  WorkImage: TImageEnView;
  LayerIndex: Integer;
begin
  WorkImage := TImageEnView.Create(nil);
  try
    WorkImage.IO.LoadFromFile('C:\sample\image.png'); 

    LayerIndex := WorkImage.LayersAdd(ielkText);
    WorkImage.LayersCurrent := LayerIndex;
    TIETextLayer(WorkImage.CurrentLayer).Width := WorkImage.IEBitmap.Width;
    TIETextLayer(WorkImage.CurrentLayer).EnableFormatting := True;
    TIETextLayer(WorkImage.CurrentLayer).RichText := '{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}' +
      '{\colortbl ;\red255\green255\blue255;} ' +
      '{\*\generator Riched20 10.0.18362}\viewkind4\uc1' +
      '\pard\sa200\sl276\slmult1\qr\cf1\fs24\lang9 Line 1\line Line 2\line A longer line 3 here\par' +
      '}';

    WorkImage.LayersMergeAll;
    WorkImage.IO.SaveToFilePNG('C:\sample\overlay.png');


  finally
    WorkImage.Free;
  end;
end;


How can I make the text color in the rich edit text consistent, regardless of the theme used? Thank you.
Go to Top of Page

yeohray2

Malaysia
106 Posts

Posted - Dec 10 2020 :  19:45:46  Show Profile  Reply
This image is when the Windows theme is used, and the above code is ran:



Next image is when the application is using the Carbon theme, same code (if you look really hard at the top right, you can just about make out the text):



Still in Carbon theme, but using a FillColor for the layer:



However, I need the non-text area to be transparent, which is why I can't set the FillColor.

Thank you.
Go to Top of Page

xequte

38610 Posts

Posted - Dec 10 2020 :  20:53:12  Show Profile  Reply
Thank you for the good bug report with detailed steps to reproduce.

Please email me for a fix.

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

yeohray2

Malaysia
106 Posts

Posted - Dec 11 2020 :  06:25:50  Show Profile  Reply
Thank you for the prompt fix and support.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: