首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 平面设计 > 图形图像 >

【通译】(70)图形

2012-08-22 
【翻译】(70)图形【翻译】(70)图形?seehttp://developer.android.com/guide/topics/graphics/index.html?原文

【翻译】(70)图形

【翻译】(70)图形

?

see

http://developer.android.com/guide/topics/graphics/index.html

?

原文见

http://developer.android.com/guide/topics/graphics/index.html

?

-------------------------------

?

Graphics

?

图形

?

-------------------------------

?

Topics

?

主题

?

* Canvas and Drawables

?

* 画布和可绘画对象

?

* Hardware Acceleration

?

* 硬件加速

?

* OpenGL

?

* OpenGL(注:Open Graphics Library的简称,一种跨语言跨平台的3D编程接口)

?

-------------------------------

?

When writing an application, it's important to consider exactly what your graphical demands will be. Varying graphical tasks are best accomplished with varying techniques. For example, graphics and animations for a rather static application should be implemented much differently than graphics and animations for an interactive game. Here, we'll discuss a few of the options you have for drawing graphics on Android and which tasks they're best suited for.

?

当编写一个应用程序时,重要的是准确地考虑你的图形要求将会是什么。不同的图形任务由不同的技术最好地实现。例如,用于一个相当静态的应用程序的图形和动画应该非常不同于用于交互式游戏的图形和动画地被实现。这里,我们将讨论你所拥有的用于在Android上绘画图形的一些选择以及它们最佳地适合于哪些任务。

?

Canvas and Drawables

?

画布和可绘画对象

?

Android provides a set of View widgets that provide general functionality for a wide array of user interfaces. You can also extend these widgets to modify the way they look or behave. In addition, you can do your own custom 2D rendering using the various drawing methods contained in the Canvas class or create Drawable objects for things such as textured buttons or frame-by-frame animations.

?

Android提供一组View部件,它们提供通用功能用于用户界面的一个广泛序列。你还可以扩展这些部件以修改它们看起来或行为的方式。额外地,你可以使用包含在Canvas类中的不同的绘画方法来做你自己的自定义二维渲染,或者创建Drawable对象用于一些事情诸如纹理化按钮或逐帧动画。

?

Hardware Acceleration

?

硬件加速

?

Beginning in Android 3.0, you can hardware accelerate the majority of the drawing done by the Canvas APIs to further increase their performance.

?

从Android 3.0开始,你可以硬件加速由Canvas API完成的大多数绘画以进一步提高它们的性能。

?

OpenGL

?

OpenGL(注:这里指Android的OpenGL|ES,和PC的OpenGL不一样)

?

Android supports OpenGL ES 1.0 and 2.0, with Android framework APIs as well as natively with the Native Development Kit (NDK). Using the framework APIs is desireable when you want to add a few graphical enhancements to your application that are not supported with the Canvas APIs, or if you desire platform independence and don't demand high performance. There is a performance hit in using the framework APIs compared to the NDK, so for many graphic intensive applications such as games, using the NDK is beneficial (It is important to note though that you can still get adequate performance using the framework APIs. For example, the Google Body app is developed entirely using the framework APIs). OpenGL with the NDK is also useful if you have a lot of native code that you want to port over to Android. For more information about using the NDK, read the docs in the docs/ directory of the NDK download.

?

Android支持OpenGL ES 1.0和2.0,(注:OpenGL|ES是OpenGL for Embedded Systems的简称,一种剪裁版的OpenGL接口,由Khronos制订,可用于移动设备)使用Android框架API以及原生地使用原生开发工具箱(NDK)。使用框架API是理想的,当你希望把一些图形加强添加到你的不支持Canvas API的应用程序时,或者如果你期望独立地执行并且不要求高性能。对比起NDK,在使用库框架API中有一个性能冲击,所以对于许多图形密集应用程序诸如游戏,使用NDK是有利的(虽然重要的是要注意,你仍然可以使用框架API获得足够的性能。例如,Google身体应用是完全使用框架API开发的)(注:这个应用貌似在Android市场上消失了)。使用NDK的OpenGL还是有用的,如果你有许多原生代码,你希望整体地移植它们到Android上(注:因为通过NDK的OpenGL头文件可以直接修改图形界面,避免通过JNI绕Java端访问图形接口)。想获得关于使用NDK的更多信息,请阅读NDK下载包docs/目录中的文档。

?

Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.

?

除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。

?

Android 4.0 r1 - 14 Feb 2012 21:12

?

-------------------------------

?

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

?

(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)

?

(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:

* ソフトウェア技術ドキュメントを勝手に翻訳

http://www.techdoctranslator.com/android

* Ley's Blog

http://leybreeze.com/blog/

* 农民伯伯

http://www.cnblogs.com/over140/

* Android中文翻译组

http://androidbox.sinaapp.com/


热点排行