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
 Drag&Drop between layers and performance
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

lago

40 Posts

Posted - Sep 26 2019 :  11:00:03  Show Profile  Reply
Hello newly! A couple of questions, one about drag & drop between layers and another about performance when editing them.

Drag & drop between layers:
The example code works great to drag an image from an ImageenMView to an ImageenView:

ImageEnView1DragDrop(TObject *Sender, TObject *Source, int X, int Y)

	idx = this->ImageEnMView1->SelectedImage;

	if (idx >= 0)
	{
	  bmp = this->ImageEnMView1->GetTIEBitmap(idx);
	  this->ImageEnView1->LayersAdd(bmp);
	  this->ImageEnView1->CurrentLayer->PosX = this->ImageEnView1->XScr2Bmp( X );
	  this->ImageEnView1->CurrentLayer->PosY = this->ImageEnView1->YScr2Bmp( Y );

	  this->ImageEnMView1->ReleaseBitmap(idx, false);
}

But ... I would like to use "Assign" to change one image to another using Drag & Drop. Is there any way to know the index of the layer where the mouse is released? Something like this:

	  this->ImageEnView1->Layers[ this->ImageEnView1->CurrentLayer->LayerIndex ]->Bitmap->Assign( bmp );


Performance by moving a layer:
When moving a layer: With the mouse button pressed while I move it, its X, Y position is not updated and it works fast. But, at the moment when I stop moving the mouse, the X, Y coordinates are updated and produce an unnecessary delay. Would it be possible to force the X, Y coordinates of the layer to be updated only when the mouse button is released?

Thanks in advance!

xequte

38611 Posts

Posted - Sep 26 2019 :  19:31:28  Show Profile  Reply
Hi

Use FindLayerAt to determine the layer at a cursor position:

https://www.imageen.com/help/TImageEnView.FindLayerAt.html

Regarding performance, I have implemented it this way for 8.7.1 (i.e. does not quality draw while mouse is down). You can email me for a pre-release.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

lago

40 Posts

Posted - Sep 27 2019 :  05:56:37  Show Profile  Reply
Thanks Nigel!

FindLayerAt work perfectly!I had not seen it in the documentation, thanks.

Regarding performance, don't worry. At the moment I have more work to do before. I'm not in a hurry but thank you very much.

Jorge.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: