Hello,
I want to know in which unit are the coordinates I get as a result of calling the function TransformPoint.
Here is what I am doing (C# code):
object DstUX, DstUY, DstUZ;
PlotSection.TransformPoint(0, srcX, srcY, null, 2, out DstUX, out DstUY, out DstUZ);
int topLeft = Math.Abs((int)Math.Round(decimal.Parse(DstUX.ToString())));
int topTop = Math.Abs((int)Math.Round(decimal.Parse(DstUY.ToString())));
But I get coordinates that are not in the same unit as the coordinates I usually use when I am drawing something on the screen (i.e. I get DstUX = -14406 and DstUY = 9210, and my screen coordinates go from: 0 to 1280 and 0 to 770).
Thanks in advance.
Lucas
Thank you for your question.
The screen here is corresponding to the canvas of DWF Viewer control but not your screen. So the negative or larger coordinates means the source drawing is out of the canvas. You can zoom out your canvas and try it again.
Hope that helps.
Thank you for the answer...
So basically what I need to do is tranform the coordinates to the ones I have on the screen.
For that I call 3 times to the method TransformPoint (to obtain the taget point, the TOP-LEFT point and the BOTTOM-RIGHT point of the current view) to be able to transform the coordinates axis and units.
The problem is that the second and third time I call to the TransformPoint method, I get the values as the first time, but I am sure that the values I give as parameter are differents. Do you know why is this happening? Or what I'm doing wrong?
Thanks in advance.
Lucas
Thank you for your question.
Please insure to use the same "SrcType" and "DstType" for your 3 times call. If it still not help, please attach your code here for us to investigate.
Thank you Herbert
Find attached a fragment of my code. Please advice.
Regards.
Lucas
Thank you for your feedback.
What are exactly values of CurrentView and simpleDrawingView before your 3 times call? Please insure you got expected values for CurrentView and simpleDrawingView previously.
Hello,
I just verified and the variables CurrentView and simpleDrawingView have the expected values. Just in case I have replaced this variables for constant values and I got the same result. See below.
PlotSection.TransformPoint(0, 8.6472, 3.7193, 0, 2, out currentViewLimitRight, out currentViewLimitBottom, out unused);
Thank you!
Lucas
Thank you for your feedback.
Please upload your test .dwf file to this thread for me use to investigate.
Can't find what you're looking for? Ask the community or share your knowledge.