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
 CopyIEBitmapToSelection
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - May 18 2015 :  17:20:14  Show Profile  Reply
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

xequte

38514 Posts

Posted - May 20 2015 :  00:51:34  Show Profile  Reply
In v6.0.2 this will be:

TImageEnView.ApplyBitmapToSelection();

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: