我正在尝试使用System.NotSupportedException: Unable to activate instance of type Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor from native handle 0x1d200001 (key_handle 0x41b8ad20). ---> System.MissingMethodException: No constructor found for Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
at Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
at --- End of managed Java.Lang.Error stack trace ---
at java.lang.Error: Java callstack:
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.n_onStatus(Native Method)
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.onStatus(Scanner_StatusListenerImplementor.java:30)
at at com.symbol.emdk.barcode.StatusCallbackInternal$StatusCallbackThread.run(StatusCallbackInternal.java:73)
at --- End of managed Java.Lang.Error stack trace ---
at java.lang.Error: Java callstack:
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.n_onStatus(Native Method)
at at mono.com.symbol.emdk.barcode.Scanner_StatusListenerImplementor.onStatus(Scanner_StatusListenerImplementor.java:30)
at at com.symbol.emdk.barcode.StatusCallbackInternal$StatusCallbackThread.run(StatusCallbackInternal.java:73)
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) [0x00058] in <filename unknown>:0
at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x00138] in <filename unknown>:0
--- End of inner exception stack trace ---
at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x001b0] in <filename unknown>:0
at Java.Lang.Object.GetObject (IntPtr handle, JniHandleOwnership transfer, System.Type type) [0x000e5] in <filename unknown>:0
at Java.Lang.Object._GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x0001a] in <filename unknown>:0
at Java.Lang.Object.GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x00000] in <filename unknown>:0
at Java.Lang.Object.GetObject[T] (IntPtr jnienv, IntPtr handle, JniHandleOwnership transfer) [0x00006] in <filename unknown>:0
at Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerInvoker.n_OnStatus_Lcom_symbol_emdk_barcode_StatusData_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0) [0x00000] in <filename unknown>:0
at at (wrapper dynamic-method) System.Object:043283ed-110f-43b7-811b-51b1dfa39e65 (intptr,intptr,intptr)
文件中的纬度/经度坐标显示城市地图。必须将这些值转换为.csv
和x
值,才能使用Processing在屏幕上显示。我的老师给了我这个代码,但是对于我的坐标,输出的地图旋转了90度。
y
有谁知道如何将// 1. normalize the value between the minimum and maximum latitude or longitude values (new value between 0 and 1)
// 2. blow up the value between 0 and 1 by muliplying by the width or height of the screen (reduced by the margin 2 * 20 pixel)
// 3. shift the position by 20 pixel for the margin
float xPosition = 20 + (width-40) * norm(l.longitude, minLongCoord, maxLongCoord);
float yPosition = 20 + (height-40) * norm(l.latitude, minLatCoord, maxLatCoord);
和x
位置旋转90度,然后又从坐标中旋转输出的地图?
编辑:翻译的问题是,如果我有鼠标点击功能,看看鼠标的形状是什么,点击和鼠标所在的形状没有对齐。
答案 0 :(得分:0)
您可以调用rotate()
函数。来自the reference:
translate(width/2, height/2);
rotate(PI/3.0);
rect(-26, -26, 52, 52);
请注意,您还必须调用translate()
函数来设置要旋转的点,然后相对于该点进行绘制。
如果您不想使用rotate()
功能,那么您首先必须弄清楚要旋转的点,然后围绕该点旋转。谷歌搜索“围绕另一个点旋转点”返回一堆结果,包括此Stack Overflow帖子:Rotating a point about another point (2D)