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
 Snap To Grid feature for vector elements
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

MrDeveloper

Switzerland
17 Posts

Posted - Sep 24 2021 :  05:05:39  Show Profile  Reply
Hello Together

I hope someone of you can help me. I need a "SnapToGrid" function for all ImageEn vector elements.
The questions would be:

1. How can I create a defined grid (configurable X and Y points)?
2. How can the vector objects that are created be snapped to this grid points?

Has anyone here done anything before with ImageEn? It would be very helpful if there was a demo application or at least a code snippet for this. Maybe Nigel can add something here in the very near future, as I can imagine it would be interesting for others as well.

Thanks for your help in advance!

xequte

38196 Posts

Posted - Sep 25 2021 :  00:47:17  Show Profile  Reply
Hi

Is this for TImageEnView layers or TImageEnVect objects?

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

MrDeveloper

Switzerland
17 Posts

Posted - Sep 25 2021 :  01:50:14  Show Profile  Reply
Hello Nigel

I think since the component TImageEnVect is legacy I better use the TImageEnView with the layer technique right? So we are talking about the TImageEnView in this case.

Thanks!
Go to Top of Page

xequte

38196 Posts

Posted - Sep 29 2021 :  01:32:06  Show Profile  Reply
Hi

You can do this in the current beta using:

// Draw a virtual grid of 20x20 pixels to make it easier to position and align layers
ImageEnView1.LayerOptions    := ImageEnView1.LayerOptions + [ loSnapToPos ];
ImageEnView1.DoubleBuffered  := True;    // Improve draw performance
ImageEnView1.DisplayGridKind := iedgSnapPoints;
ImageEnView1.LayersSnapDist  := 20;
ImageEnView1.Update();


Please email me to test this.

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

MrDeveloper

Switzerland
17 Posts

Posted - Sep 29 2021 :  03:01:22  Show Profile  Reply
Hello Nigel

Do you mean by "current" beta which you had already emailed me? If so, these extensions are unfortunately not yet included in my version (1021 Beta 928).

Another idea for the "SnapTo" function would be if it could snap to existing shape layers. For example, the current selection rectangle snaps to the outer box via "SnapDist" of a neighboring shape layer, so it would be possible to quickly align elements with each other. Ideally in width, height and position.

Is it already possible in the current version 10.2.0 to automatically jump to the Grips/Guideline elements defined in the Ruler?

If there is a new version, could you send it to me at the same email address as the last one? BTW I had also sent you yesterday by e-mail a customized "AddSpots" demo application with some test cases and questions.
Go to Top of Page

xequte

38196 Posts

Posted - Sep 29 2021 :  21:35:30  Show Profile  Reply
Hi Kai,

Please email me for an updated beta that includes the functionality. We will consider snapping to align with other objects for a future version.

I've not had time to look at your application, I'm afraid.



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