将 C# 移植到 Android
我正在尝试编写一个在 jpeg 上创建球形过滤器的应用程序。我已经在java代码上苦苦挣扎了一段时间,由于android上不支持bufferedimage,该代码会造成失真。我得到了 this 链接,该链接提供了用 C# 编写的鱼眼失真。我正在考虑使用 ndk 将此代码移植到 android。我正在按顺序关注此链接设置 ndk.我的问题是我想使用的代码是用 c# 编写的,而上面关于如何设置 ndk 的给定链接给出了用 c++/c 编写的示例。这是一个问题吗?基本上我要问的是,如果我使用第二个链接设置我的开发机器,我是否能够使用第一个链接中的代码?谢谢。垫
i'm trying to code an app that creates a spherize filter on a jpeg. i've been struggling for a while with java code that does the distortion due to bufferedimage not being supported on android. i've been given this link that give a fisheye distortion written in C#. i'm considering porting this code to android using the ndk. i'm following this link in order to set up the ndk. my question is the code i'd like to use is written in c# whereas the given link above on how to set up the ndk is giving examples written in c++/c. is this a problem? Basically what i'm asking is if i set up my dev machine with the second link will i be able to use the code in the first link? thanks. mat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想要做的是使用 opengl es (http://www.khronos.org/opengles/< /a>) 首先是你的开发机器。一旦你到达那里,将其传输到 Android 就会更容易。
您最初是使用 DirectX 库用 C# 编写的吗?
您可能也想使用 Java 中的 OpenGL ES (http://developer.android .com/guide/topics/graphics/opengl.html),具体取决于您需要的性能。
更新:
如果您想从 C# 移植到 OpenGL ES,您可以查看这个库,我没有使用过该库,但看起来不错:http://www.opentk.com/。
要移植到 Java,您可以查看以下内容: http://www.badlogicgames.com/wordpress/ ?p=343
在尝试在 Android 上实现此功能之前,您可能希望首先以某种语言将代码移植到 OpenGL ES,然后一旦完成,那么转到 Android 将会变得相当简单,因为您主要部分已经解决了。
What you may want to do is port it using opengl es (http://www.khronos.org/opengles/) first, and your development machine. Once you get there then getting it to the android will be easier.
Did you write this in C# using the DirectX library originally?
You may want to just use OpenGL ES from Java also (http://developer.android.com/guide/topics/graphics/opengl.html), depending on the performance you need.
Update:
If you want to port from C# to OpenGL ES you can look at this library, which I haven't used, but appears good: http://www.opentk.com/.
For porting to Java you can look at this: http://www.badlogicgames.com/wordpress/?p=343
Before trying to get this on the Android, you may want to port the code to OpenGL ES first, in some language, then once you have the done, then going to Android will be considerably simpler as you will have the main part worked out already.