ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Drag&Drop between layers and performance

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
lago Posted - Sep 26 2019 : 11:00:03
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!
2   L A T E S T    R E P L I E S    (Newest First)
lago Posted - Sep 27 2019 : 05:56:37
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.
xequte Posted - Sep 26 2019 : 19:31:28
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