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
 Create a Layer in a TIEBitmap directly?

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
PeterPanino Posted - Oct 28 2024 : 05:02:00
I currently use this code to add a "PAID" stamp to a TIEBitmap:

procedure AddPaidStampToBitmap(Bmp: TIEBitmap);
var
  TempImageEnView: TImageEnView;
begin
  // Create a temporary TImageEnView to handle layers:
  TempImageEnView := TImageEnView.Create(nil);
  try
    // Load the bitmap into TImageEnView:
    TempImageEnView.IEBitmap.Assign(Bmp);  // Copy TIEBitmap content to TImageEnView

    // Apply a "Paid" stamp to the image:
    with TempImageEnView do
    begin
      LayersAdd('PAID', 48, clRed, 'Arial Black', [fsBold]);
      CurrentLayer.Rotate := 30;
      TIETextLayer(CurrentLayer).SizeToText();
      CurrentLayer.PosX := IELayer_Pos_HCenter;
      CurrentLayer.PosY := IELayer_Pos_VCenter;
      LayersMergeAll();
    end;

    // Copy the result back to the original TIEBitmap:
    Bmp.Assign(TempImageEnView.IEBitmap);
  finally
    TempImageEnView.Free;
  end;
end;


Is it possible to do this with the TIEBitmap directly without using the temporary TImageEnView?

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 28 2024 : 17:40:04
Yes, you can use one of the text out methods:

http://www.imageen.com/help/TIECanvas.DrawText.html
http://www.imageen.com/help/TImageEnProc.TextOut.html

Note: The Proc method supports positioning consts


Nigel
Xequte Software
www.imageen.com