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
 How to create a composite image?

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
zcgogo Posted - Jun 03 2013 : 05:39:27
How to create a composite image by combining several separate image with ImageEn?
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jun 03 2013 : 06:52:58
The way to do this is to place your main image in layer 0, the add the other images into additional layers. The images you add to the layers must be 32-bit with alpha channel. After adding the layers move them to the position you desire then merge the layers.
To move the layers set ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers] to allow selecting, moving and resizing the layers.

Something like this:
ImageEnView1.IO.Params.BMP_HandleTransparency := True;
{ Add a layer }
ilayer := ImageENView1.LayersAdd;
ImageEnView1.CurrentLayer.VisibleBox := True;
ImageEnView1.CurrentLayer.Selectable := True;
ImageEnView1.LayersDrawBox := True;
{ Load the image }
ImageEnView1.IO.LoadFromFile(iFilename);
{ Make the layer transparent }
ImageEnView1.Proc.SetTransparentColors(ImageEnView1.Layers[ilayer].Bitmap.Pixels[0,
ImageEnView1.Layers[ilayer].Bitmap.Height - 1],
  ImageEnView1.Layers[ilayer].Bitmap.Pixels[0,
    ImageENView1.Layers[ilayer].Bitmap.Height - 1], 0);
{ Allow selecting, moving and resizing the layers }
ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
ImageEnView1.EnableAlphaChannel := True;

Then after you position the layers:
{ ImageENView.LayersMergeAll - removes alpha values so we merge all the layers individually to maintain the alpha channel }
for i := ImageEnView1.LayersCount - 1 downto 1 do
  ImageEnView1.LayersMerge(0, i);

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html