Android ApiDemos示例解析(86):Graphics->Xfermodes

本例显示了图形的前景和背景融合时Poter Duffer的各个模式,也就是通常说的Alpha Blending,Alpha Composting ,参见 Android ApiDemos示例解析(59):Graphics->ColorFilters

PorterDuffXfermode 定义的模式如下:

private static final Xfermode[] sModes = {
 new PorterDuffXfermode(PorterDuff.Mode.CLEAR),
 new PorterDuffXfermode(PorterDuff.Mode.SRC),
 new PorterDuffXfermode(PorterDuff.Mode.DST),
 new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER),
 new PorterDuffXfermode(PorterDuff.Mode.DST_OVER),
 new PorterDuffXfermode(PorterDuff.Mode.SRC_IN),
 new PorterDuffXfermode(PorterDuff.Mode.DST_IN),
 new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT),
 new PorterDuffXfermode(PorterDuff.Mode.DST_OUT),
 new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP),
 new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP),
 new PorterDuffXfermode(PorterDuff.Mode.XOR),
 new PorterDuffXfermode(PorterDuff.Mode.DARKEN),
 new PorterDuffXfermode(PorterDuff.Mode.LIGHTEN),
 new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY),
 new PorterDuffXfermode(PorterDuff.Mode.SCREEN)
};


展开阅读全文

Android 1.6 apidemos 报好多错

08-05

我现在主要用2.1,adt为0.97,运行良好。rn同学有个g2,是1.6的,rn所以想试试,rn1.6sdk我以前安装的,一直没怎么用。rn今天一用,让我大吃一惊,简单的程序也跑不起来。rn然后试下例子,rn报错如下:rnrn[2010-08-05 15:01:50 - ApiDemos] libpng warning: Ignoring attempt to set cHRM RGB triangle with zero arearn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\values\strings.xml:365: error: Apostrophe not preceded by \ (in I'm on! :))rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\values\strings.xml:366: error: Apostrophe not preceded by \ (in I'm off! :()rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\values\strings.xml:643: error: Apostrophe not preceded by \ (in The Android platform is a software stack for mobile devices including anrn[2010-08-05 15:01:50 - ApiDemos] operating system, middleware and key applications. Developers can creatern[2010-08-05 15:01:50 - ApiDemos] applications for the platform using the Android SDK. Applications are writtenrn[2010-08-05 15:01:50 - ApiDemos] using the Java programming language and run on Dalvik, a custom virtualrn[2010-08-05 15:01:50 - ApiDemos] machine designed for embedded use which runs on top of a Linux kernel.rn[2010-08-05 15:01:50 - ApiDemos] rn[2010-08-05 15:01:50 - ApiDemos] If you want to know how to develop applications for Android, you're in thern[2010-08-05 15:01:50 - ApiDemos] right place. This site provides a variety of documentation that will help yourn[2010-08-05 15:01:50 - ApiDemos] learn about Android and develop mobile applications for the platform.rn[2010-08-05 15:01:50 - ApiDemos] rn[2010-08-05 15:01:50 - ApiDemos] An early look at the the Android SDK is also available. It includes samplern[2010-08-05 15:01:50 - ApiDemos] projects with source code, development tools, an emulator, and of course allrn[2010-08-05 15:01:50 - ApiDemos] the libraries you'll need to build an Android application. What would it takern[2010-08-05 15:01:50 - ApiDemos] to build a better mobile phone?rn[2010-08-05 15:01:50 - ApiDemos] )rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:87: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:100: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:117: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:129: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\xml\advanced_preferences.xml:32: error: Error: No resource found that matches the given name (at 'summaryOn' with value '@string/summary_on_advanced_toggle_preference').rn[2010-08-05 15:01:50 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\xml\advanced_preferences.xml:32: error: Error: No resource found that matches the given name (at 'summaryOff' with value '@string/summary_off_advanced_toggle_preference').rn[2010-08-05 15:06:40 - ApiDemos] libpng warning: Ignoring attempt to set cHRM RGB triangle with zero arearn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\values\strings.xml:365: error: Apostrophe not preceded by \ (in I'm on! :))rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\values\strings.xml:366: error: Apostrophe not preceded by \ (in I'm off! :()rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\values\strings.xml:643: error: Apostrophe not preceded by \ (in The Android platform is a software stack for mobile devices including anrnrn[2010-08-05 15:06:40 - ApiDemos] to build a better mobile phone?rn[2010-08-05 15:06:40 - ApiDemos] )rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:87: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:100: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:117: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\layout\scrollbar3.xml:129: error: Error: No resource found that matches the given name (at 'text' with value '@string/scrollbar_3_text').rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\xml\advanced_preferences.xml:32: error: Error: No resource found that matches the given name (at 'summaryOn' with value '@string/summary_on_advanced_toggle_preference').rn[2010-08-05 15:06:40 - ApiDemos] D:\Program Files\Android\android-sdk-windows\platforms\android-4\samples\ApiDemos\res\xml\advanced_preferences.xml:32: error: Error: No resource found that matches the given name (at 'summaryOff' with value '@string/summary_off_advanced_toggle_preference').rnrn不知是什么原因呢? 论坛

没有更多推荐了,返回首页