`

【翻译】(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/


分享到:
评论

相关推荐

    程序设计方法(How_To_Design_Programs)-MIT.pdf

    8.5 布尔值表达式 70 8.6 变量定义 71 8.7 结构体的定义 72 第二部分 任意数目数据的处理 第9章 复合数据类型之二:表 77 9.1 表 77 9.2 任意长的表的数据定义 80 9.3 处理任意长的表 82 9.4 设计自引用数据定义的...

    Android程序设计基础

     本书由张波、高朝勤、杨越和徐红霞等翻译,在翻译过程中得到了人民邮电出版社图灵公司编辑的热心帮助,在此一并致谢。由于译者的知识水平有限,加之时间比较仓促,文中难免会出现一些疏漏,恳请广大读者给予批评...

    PowerPoint.2007宝典 3/10

    4.1.2 从“幻灯片”窗格中新建幻灯片 70 4.1.3 通过版式创建幻灯片 71 4.1.4 复制幻灯片 71 4.2 插入来自外部源的内容 72 4.2.1 复制来自其他演示文稿的幻灯片 72 4.2.2 通过大纲插入新幻灯片 73 4.2.3...

    PowerPoint.2007宝典 10/10

    4.1.2 从“幻灯片”窗格中新建幻灯片 70 4.1.3 通过版式创建幻灯片 71 4.1.4 复制幻灯片 71 4.2 插入来自外部源的内容 72 4.2.1 复制来自其他演示文稿的幻灯片 72 4.2.2 通过大纲插入新幻灯片 73 4.2.3...

    人工智能发展历程.pdf

    随着⼤数据、云计算、互联⽹、物联⽹等信息技术的发展,泛在感知数据和图形处理器等计算平台推动以深度神经⽹络为代表的⼈⼯智 能技术飞速发展,⼤幅跨越了科学与应⽤之间的"技术鸿沟",诸如图像分类、语⾳识别、...

    一款非常好的WPF编程宝典2010 源代码

    4.2.2 对齐方式 70 4.2.3 外边距 71 4.2.4 最小尺寸、最大尺寸以及 显式地设置尺寸 72 4.3 WrapPanel面板和DockPanel 面板 74 4.3.1 WrapPanel面板 74 4.3.2 DockPanel面板 75 4.3.3 嵌套布局包容器 77 4.4...

    Apress.Pro.WPF.in.C.Sharp.2008.2nd.Edition.Feb.2008

    4.2.2 对齐方式 70 4.2.3 外边距 71 4.2.4 最小尺寸、最大尺寸以及 显式地设置尺寸 72 4.3 WrapPanel面板和DockPanel 面板 74 4.3.1 WrapPanel面板 74 4.3.2 DockPanel面板 75 4.3.3 嵌套布局包容器 77 4.4 Grid...

    精通Odoo开发和使用

    4.4 导入一个翻译 20 4.5 新的 Demo 用户 20 4.6 模块管理 21 4.7 修改公司信息 21 4.8 打开技术特性支持之后 22 4.9 进销存和财务系统的抽象讨论 22 4.9.1 以采购部门为例 23 4.10 安装和配置模块 24 5 创建自己的...

    JBPM4工作流应用开始指南.rar

    62 5.2 流程引擎API 64 5.3 利用API部署流程 67 5.4 通过API删除已部署的流程 69 5.5 使用API发起新的流程实例 69 5.5.1 发起流程实例的常规方法 70 5.5.2 指定业务键发起流程实例 70 5.5.3 指定变量发起流程实例 71...

    vc 抓屏程序:截取当前屏幕核心代码.rar

    例如,MFC70DEU.DLL 包含翻译成 德语的资源。) 如果不这样做,应用程序的某些 UI 元素 将保留为操作系统的语言。 /////////////////////////////////////////////////////////////////////////////

Global site tag (gtag.js) - Google Analytics