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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to create a composite image?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zcgogo

China
1 Posts

Posted - Jun 03 2013 :  05:39:27  Show Profile  Reply
How to create a composite image by combining several separate image with ImageEn?

w2m

USA
1990 Posts

Posted - Jun 03 2013 :  06:52:58  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: