I am actually using 2 TimageEnVects for this, VCastVect and VTempImageENVect. The VCastVect does all the image effects where the background is changed to transparent. I had to save VCastVect to a png file first and load it to the layer of VTempImageENVect to preserve the transparency:
VCastVect.IO.SaveToFile( 'c:\new-cast.png' );
VTempImageENVect.LayersAdd;
VTempImageEnVect.LayersCurrent := 1;
VTempImageENVect.IO.LoadFromFilePNG( 'c:\new-cast.png' );
VTempImageENVect.Layers[ 1 ].PosX := 0;
VTempImageENVect.Layers[ 1 ].PosY := 0;
VTempImageENVect.Layers[ 1 ].Width := VCastVect.IEBitmap.Width;
VTempImageENVect.Layers[ 1 ].Height := VCastVect.IEBitmap.Height;
VTempImageEnVect.LayersMergeAll(True);
VTempImageEnVect.Update;
I tried doing the following, but the transparency in VCastVect did not transfer to the layer of VTempImageENVect:
VTempImageENVect.LayersAdd;
VTempImageEnVect.LayersCurrent := 1;
VTempImageENVect.IEBitmap.Assign( VCastVect.IEBitmap );
VTempImageENVect.Layers[ 1 ].PosX := 0;
VTempImageENVect.Layers[ 1 ].PosY := 0;
VTempImageENVect.Layers[ 1 ].Width := VCastVect.IEBitmap.Width;
VTempImageENVect.Layers[ 1 ].Height := VCastVect.IEBitmap.Height;
VTempImageEnVect.LayersMergeAll(True);
VTempImageEnVect.Update;
Also, I noticed that TImageEnVect.IEBitmap.CopyToBitmap ony takes a TBitmap. How do I copy a TIEBitmap to another TIEBitmap?
Thanks very much Nigel.
Andy