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
 Writing text to ImageEn Layer and resize text

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
UBeyerAtWork Posted - Sep 20 2018 : 04:22:05
Hi together,

im starting to display text on a form (invoice as tiff).
After that I have added some text and can move it to right position.

Now I'm looking to resize text in width and height (seperate)

Load image, add text is already done. Used the source sample of William Miller

fslCold is a Stringlist

fiLayer := ImageEnView1.LayersCreateFromText(fslCold.Text,
                                               'Courier New',
                                               25,
                                               clBlack,
                                               AFontStyle,
                                               False,
                                               0,
                                               0,
                                               0,
                                               True
                                              );


Moving is done inside Keydown event of form (Keydown at imageen is not working im my version)

if (fiLayer <> -1) then begin
    lintMove := 10;
    if (Shift = [ssCtrl]) then lintMove := 1;
    if (Shift = [ssShift]) then lintMove := 100;

    if (Key = 39) then ImageEnView1.Layers[fiLayer].PosX := ImageEnView1.Layers[fiLayer].PosX + lintMove;
    if (Key = 37) then ImageEnView1.Layers[fiLayer].PosX := ImageEnView1.Layers[fiLayer].PosX - lintMove;
    if (Key = 40) then ImageEnView1.Layers[fiLayer].PosY := ImageEnView1.Layers[fiLayer].PosY + lintMove;
    if (Key = 38) then ImageEnView1.Layers[fiLayer].PosY := ImageEnView1.Layers[fiLayer].PosY - lintMove;

    ImageEnView1.Update;
  end;


I'm glad about any tip

Thanks Uwe

Uwe Beyer
Software Engineering / Consulting (Personalsystem/Archivsystem/Web)

IS International Sourcing AG
Stockwiesenstr. 1
CH-8240 Thayngen
4   L A T E S T    R E P L I E S    (Newest First)
UBeyerAtWork Posted - Sep 28 2018 : 02:42:13
Hi Nigel,

sorry I was offline some days. I want to test using multiple layers.
There are maximum 67 lines of text.

Much Greetings from Germany
Uwe

Uwe Beyer
Software Engineering / Consulting (Personalsystem/Archivsystem/Web)

IS International Sourcing AG
Stockwiesenstr. 1
CH-8240 Thayngen
xequte Posted - Sep 21 2018 : 17:19:16
Hi Uwe

Unfortunately GDI+ is used to draw the text so the line height cannot be changed.

You say you tried outputting a text layer for each line, but it was too slow. How many lines were there?

Nigel
Xequte Software
www.imageen.com
UBeyerAtWork Posted - Sep 21 2018 : 01:56:20
Hi Nigel,

thanks for that. I have changed to TIETextLayer (below).

My problem is how to change the line spacing between two text rows.
Is there no posibility to set the line spacing? I have tried a solution
to read line by line and make positioning with drawtext into a layer, but it's very slow.

We have text files from our old unix system. The text was printed with dot matrix
printer. And in this time (long ago) we had CPI & LPI. Now we had to show the scaned
print form and put the text onto the form (own archiv system).

Much Greetings
Uwe

// =========================================================================
  // Load Form matching to document

  AFontStyle := [];
  ImageEnView1.LayersClear;
  ImageEnView1.Clear;
  ImageEnView1.MouseInteract := ImageEnView1.MouseInteract + [miSelectZoom];
  ImageEnView1.OnDblClick := imgDblClick;
  ImageEnView1.IO.LoadFromFileTIFF(gstFormular + qrwColdData.FieldByName('Form').AsString);
  ImageEnView1.Zoom := 100;

  fiColdX := qrwColdData.FieldByName('ColdPosX').AsInteger;
  fiColdY := qrwColdData.FieldByName('ColdPosY').AsInteger;
  fiFontSize := qrwColdData.FieldByName('ColdFontSize').AsInteger;

  fiLayer := ImageEnView1.LayersAdd(ielkText, fiColdX, fiColdY, ImageEnView1.IO.Params.Width, ImageEnView1.IO.Params.Height);
  TIETextLayer( ImageEnView1.CurrentLayer ).Font.Name := 'Courier New';
  TIETextLayer( ImageEnView1.CurrentLayer ).Font.Height := fiFontSize;
  TIETextLayer( ImageEnView1.CurrentLayer ).Font.Color := clBlack;
  TIETextLayer( ImageEnView1.CurrentLayer ).Font.Style := AFontStyle;
  TIETextLayer( ImageEnView1.CurrentLayer ).Font.Quality := fqClearType;
  TIETextLayer( ImageEnView1.CurrentLayer ).Text := fslCold.Text;
  TIETextLayer( ImageEnView1.CurrentLayer ).BorderColor := clBlack;
  TIETextLayer( ImageEnView1.CurrentLayer ).BorderWidth := 2;
  ImageEnView1.Update;
  // =========================================================================


Uwe Beyer
Software Engineering / Consulting (Personalsystem/Archivsystem/Web)

IS International Sourcing AG
Stockwiesenstr. 1
CH-8240 Thayngen
xequte Posted - Sep 20 2018 : 19:47:31
Hi Uwe

LayersCreateFromText is an older method that creates an image layer (TIEImageLayer) from text. Now that there are layer methods, you should generally create text layers (TIETextLayer) instead.

ImageEn should now also automatically movement of the selected layer using the cursor keys, or sizing if Ctrl key is pressed. You can force sizing by adding iessCtrl_KeySizing to ImageEnView1.ShiftKeyLock.

https://www.imageen.com/help/TImageEnView.ShiftKeyLock.html

Nigel
Xequte Software
www.imageen.com