Is there a function to CopyIEBitmapToSelection method?
I'd am trying to figure out how to flip a selection vertically so I tried to use ImageEnView1.CopySelectionToIEBitmap(iIEBitmap) to get a bitmap from the selection, but I do not see a way to copy the iIEBitmap back to the selection after flipping it vertically.
Any suggestions?
Update: I managed to flip the selection but the alphachannel is lost!!!
procedure TForm1.FlipVertically1Click(Sender: TObject);
var
iLayer: Integer;
iIEBitmap: TIEBitmap;
iImageEnProc: TImageEnProc;
begin
if ImageEnView1.Selected then
begin
ImageEnView1.Proc.SaveUndoCaptioned('Flip Selection Vertically' +
IntToStr(ImageEnView1.Proc.UndoCount));
Undo1.Hint := ImageEnView1.Proc.UndoCaptions[0];
{ Copy selected area and create a new layer }
iLayer := ImageEnView1.LayersCreateFromSelection;
ImageEnView1.DeSelect;
iImageEnProc := TImageEnProc.CreateFromBitmap
(ImageEnView1.Layers[iLayer].Bitmap);
try
iImageEnProc.Flip(fdVertical);
ImageEnView1.Layers[iLayer].Bitmap := iImageEnProc.AttachedIEBitmap;
finally
iImageEnProc.Free;
end;
ImageEnView1.Update;
ImageEnView1.Bitmap.Modified := ImageEnView1.Proc.UndoCount > 0;
{ Turn on Layers selection }
ImageEnView1.Gestures.Pan.Enabled := False;
ImageEnView1.Gestures.Zoom.Enabled := False;
ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
end;
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development