ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Get Font Height from TIETextLayer Overflow=shrink

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
john_siggy@yahoo.com Posted - Nov 12 2019 : 21:17:34
Trying to get the font Size/Height from a TIETextLayer where Overflow=shrink.

As the text layer is resized the font size/height changes. What is the new value of font size/height? TIETextLayer.Font.Height gives the max font value not the currently scaled down value. Not sure what fTextDrawFontH does but it does not seem to get the new scaled down value.

Regards,

10   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Nov 18 2019 : 20:25:19
Hi John

Synchronize is necessary because calls to the Layer bitmap may require access to the user interface.

I will expose fTextDrawFontH as the property TextDrawFontHeight in v8.7.6. If it is null you will need to draw the layer to initialize it (or call CopyToBitmap for example).



Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Nov 16 2019 : 18:10:36
Hey Nigel,
Below please find my troubled code. This code is running in a thread and I need to Synchronize the CopyToBitmap procedure. If I don't synchronize, I get:

Access Violation at address X in module 'gdiplus.dll'. Read of address FFFFFFFFFFFFFFFF


for i := 1 to AnnotationImageEn.LayersCount - 1 do
begin
  //
  bmp := TIEBitmap.create;
  TIETextLayer(layers[i]).Text := 'Just a Test';
  //
  // Why need it be synchronized ???
  synchronize(procedure begin
     AnnotationImageEn.Layers[i].CopyToBitmap( bmp);
  end);
  bmp.DrawToCanvasWithAlpha(DestCanvas, PosX, PosY, 127, 1);
  bmp.Free;
  //
end;

Thanks again...
xequte Posted - Nov 14 2019 : 15:57:26
Hi

Are you able to send me a simple demo that reproduces the GDI+ errors?



Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Nov 14 2019 : 13:15:49
Thanks for the feedback. Get GDI+ errors with layers drawing as I access it too frequently per second. Would be nice to have fTextDrawFontH availiable.

xequte Posted - Nov 13 2019 : 21:11:23
Hi John

Why not uses the layers own drawing, e.g.

var
  bmp: TIEBitmap;
begin
  bmp := TIEBitmap.Create();
  try
    CopyToBitmap( bmp, DrawWidth, DrawHeight, True, UseDisplayAR );
    bmp.DrawToCanvas( DestCanvas, 0, 0 );
  finally
    bmp.Free;
  end;
end;



Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Nov 13 2019 : 20:52:44
would like to TextOut to a Canvas and need fTextDrawFontH (can't use Font.Size) to render the text in the proper size.
xequte Posted - Nov 13 2019 : 15:40:00
Hi John

fTextDrawFontH is not stored. It is only updated after drawing the Text Layer. Can you tell me how you are using the information. Perhaps I need a public property.

Nigel
Xequte Software
www.imageen.com
john_siggy@yahoo.com Posted - Nov 13 2019 : 12:18:09
Clarification:

TImageEnView works fine in saving/restoring from a blob. Judging from results, fTextDrawFontH is indeed being saved correctly into the blob. For some reason I always get 0 values for fTextDrawFontH and tag using ImageEnView1.LayersImport and
LayersExport;
john_siggy@yahoo.com Posted - Nov 13 2019 : 12:08:15
For some reason neither fTextDrawFontH nor Tag seem to persist after the textlayer is saved/reloaded from a db blob. Others variable like Font and Name work just file. Any clue ???
xequte Posted - Nov 12 2019 : 21:50:39
Hi

Yes, you can use fTextDrawFontH. It is the height value of the drawn font (i.e. Font.Height).



Nigel
Xequte Software
www.imageen.com