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
 Add Text Layer to large TIF - eOutOfResources

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
caryals Posted - Mar 17 2022 : 12:47:54

I am encountering a resource issue merging a text layer to the top of an image using 64bit 10.2.0 library. From another post I tried setting location to file. I included some sample and image information. Any suggestions?

procedure test;
  var
   FIEView: TImageEnView;
  begin
    FIEView := TImageEnView.Create(nil);
    try
      IEGlobalSettings().DefMinFileSize := -1;
      FIEView.fIEBitmap.MinFileSize := 0;
      FIEView.fIEBitmap.Location := iefile;
      FIEView.fIEBitmap.ParamsEnabled := true;
      FIEView.IO.LoadFromFile('c:\workarea\a.tif');
      FIEView.Proc.ImageResize(0, 450, 0, 0);
      //review orig image adjusted
      FIEView.Update();
      FIEView.IO.SaveToFile('c:\workarea\a-1.tif');

      //Image.IEView.LayersAdd(ielkText);
      FIEView.LayersAdd('Adding Text', 42, clBlack,'Arial', []);
      FIEView.LayersMergeAll(); //eOutOfResources  The parameter is incorrect
      FIEView.Update(); FIEView.IO.SaveToFile('c:\workarea\a-2.tif');

    finally
      FIEView.Free;
    end;

  end;




Thanks,
Andrew



Andrew Ryals
2   L A T E S T    R E P L I E S    (Newest First)
caryals Posted - Mar 18 2022 : 02:12:26
Thank you Nigel. Option 1 failed. Option 2 worked.

Andrew Ryals
xequte Posted - Mar 17 2022 : 21:53:32
Hi Andrew

Text output requires a canvas, which means that the location has to be converted to TBitmap. Naturally TBitmap is not great with resource handling.

Try drawing the texting with FIEView.Proc.TextOut(). Though I expect that will still fail because it still requires a canvas.

https://www.imageen.com/help/TImageEnProc.TextOut.html


The final solution is to output the text to a TIEBitmap, and the draw the bitmap on your large bitmap. This will avoid usage of the canvas on the large bitmap and should resolve the issue:

https://www.imageen.com/help/TIEBitmap.DrawToTIEBitmap.html

Nigel
Xequte Software
www.imageen.com