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
 Layers[0].ConvXScr2Bmp & ConvYScr2Bmp wrong result
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

rtvdoorn

Netherlands
7 Posts

Posted - Apr 24 2019 :  10:03:12  Show Profile  Reply
Hi,

In our application we handle rotation ourselves and not through the rotate interaction. To do this, we need to determine the current mouse coordinates with regards to the background image layer (layer 0) to calculate rotating angles. However, we have noticed that for a few mousemove events, ConvXScr2Bmp and ConvYScr2Bmp give incorrect results. The coordinate returned is too far to the top left compared to the actual position.

I have been able to get this same result in the Demos\Other\MouseInteract demo by implementing the OnMouseMove event as follows:

if ssLeft in Shift then
 begin
   x2 := ImageEnView1.Layers[0].ConvXScr2Bmp(x);
   y2 := ImageEnView1.Layers[0].ConvyScr2Bmp(y);
   Memo1.Lines.Add(x2.ToString + ', ' + y2.ToString + ' - ' +  x.ToString + ', ' + y.ToString);
 end;


The result can be seen in the screenshot below (as well as in the actual rotation of the image, which suddenly flips around). As you can see in the last few lines of the Memo on the right, the Y coordinate of the mouse cursor does not change, but the result of ImageEnView1.Layers[0].ConvyScr2Bmp(y); suddenly jumps 90 pixels.

We are using ImageEn 8.1.1, but the effect was in our application also still visible with ImageEn 8.3.

We have also tried using ImageEnView1.XScr2Bmp / YScr2Bmp, but these show the same effect.

Can you advice?


xequte

38182 Posts

Posted - Apr 28 2019 :  19:40:52  Show Profile  Reply
Hmmm, I'm having trouble reproducing that. Are there specific steps I can take, or can it be reproduced using code?



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

rtvdoorn

Netherlands
7 Posts

Posted - Apr 29 2019 :  03:29:23  Show Profile  Reply
I took the demo for mouse interactions, no code changes to the demo itself. Add a memo and the OnMouseMove event as described in my initial post.

Then, add an image to the demo, set the interaction to rotate and start rotating by moving in a straight line to the right, so the left mouse button is pressed the whole time.

Additionally (maybe that influences it?), I use a 3 monitor setup. The monitors are identified by Windows from left to right as follows:

| 3 | 2 | 1 |

with the following specs:
3: 1920x1080 @ 96dpi (100% scaling) in portrait mode
2: 3840x2160 @ 192dpi (200% scaling) in landscape
1: 1920x1080 @ 96dpi (100% scaling) in landscape

I compile and run everything on screen 2 (the 4k monitor).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: