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
 Add an Image Layer that contains the current image from the clipboard?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Oct 24 2022 :  10:04:02  Show Profile  Reply
I am trying to add an Image Layer that contains the current image from the clipboard:

ImageEnViewDummy.Proc.PasteFromClipboard();
  var NewLayer := ImageEnViewMain.LayersAdd(ielkImage);
  ImageEnViewMain.Layers[NewLayer].Assign(ImageEnViewDummy.Layers[0]);
  ImageEnViewMain.Layers[NewLayer].Selectable := True;
  ImageEnViewMain.Layers[NewLayer].Selected := True;
  ImageEnViewMain.MouseInteractLayers := [mlMoveLayers, mlResizeLayers, mlRotateLayers];


1. The Image Layer is created with the image from the clipboard. However, the Layer cannot be moved, resized, or rotated. Nor does it have any handles. Why?

2. Isn't there a simple built-in method to add an Image Layer that contains the current image from the clipboard?

PeterPanino

933 Posts

Posted - Oct 24 2022 :  10:20:16  Show Profile  Reply
I've solved the problem. This now works:

ImageEnViewDummy.Proc.PasteFromClipboard();
  var NewLayer := ImageEnViewMain.LayersAdd(ielkImage);
  ImageEnViewMain.Layers[NewLayer].Bitmap.Assign(ImageEnViewDummy.IEBitmap);
  ImageEnViewMain.MouseInteractLayers := [mlMoveLayers, mlResizeLayers, mlRotateLayers];


1. Why the previous version didn't work?

2. The question remains: Isn't there a simple built-in method to add an Image Layer that contains the current image from the clipboard?
Go to Top of Page

xequte

38610 Posts

Posted - Oct 24 2022 :  22:24:10  Show Profile  Reply
Hi Peter

By default, Layer 0 (background) does not have a visible selection border (VisibleBox = False). Your call:

  ImageEnView1.Layers[NewLayer].Assign(ImageEnViewDummy.Layers[0]);


Assigns the layer properties of the ImageEnViewDummy background to the new layer, so VisibleBox = False. You could just assign the bitmap:

  ImageEnView1.Layers[NewLayer].Bitmap.Assign(ImageEnViewDummy.Layers[0].Bitmap);


But an easier method is just:

  ImageEnView1.LayersCreateFromClipboard();



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