- 浏览: 47192 次
- 性别:
- 来自: 深圳
最新评论
package com.example.android.apis.graphics; // Need the following import to get access to the app resources, since this // class is in a sub-package. //import com.example.android.apis.R; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.View; public class Arcs extends GraphicsActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); } private static class SampleView extends View { private Paint[] mPaints; private Paint mFramePaint; private boolean[] mUseCenters; private RectF[] mOvals; private RectF mBigOval; private float mStart; private float mSweep; private int mBigIndex; private static final float SWEEP_INC = 2; private static final float START_INC = 15; public SampleView(Context context) { super(context); mPaints = new Paint[4]; mUseCenters = new boolean[4];//是否<!--StartFragment--> 画扇形 mOvals = new RectF[4]; mPaints[0] = new Paint(); mPaints[0].setAntiAlias(true); mPaints[0].setStyle(Paint.Style.FILL);//设置填充方式 mPaints[0].setColor(0x88FF0000); mUseCenters[0] = false; mPaints[1] = new Paint(mPaints[0]); mPaints[1].setColor(0x8800FF00); mUseCenters[1] = true; mPaints[2] = new Paint(mPaints[0]); mPaints[2].setStyle(Paint.Style.STROKE); mPaints[2].setStrokeWidth(4);//边框粗细 mPaints[2].setColor(0x880000FF); mUseCenters[2] = false; mPaints[3] = new Paint(mPaints[2]); mPaints[3].setColor(0x88888888); mUseCenters[3] = true; mBigOval = new RectF(40, 10, 280, 250); mOvals[0] = new RectF( 10, 270, 70, 330); mOvals[1] = new RectF( 90, 270, 150, 330); mOvals[2] = new RectF(170, 270, 230, 330); mOvals[3] = new RectF(250, 270, 310, 330); mFramePaint = new Paint(); mFramePaint.setAntiAlias(true); mFramePaint.setStyle(Paint.Style.STROKE); mFramePaint.setStrokeWidth(0); } private void drawArcs(Canvas canvas, RectF oval, boolean useCenter, Paint paint) { canvas.drawRect(oval, mFramePaint); canvas.drawArc(oval, mStart, mSweep, useCenter, paint); } @Override protected void onDraw(Canvas canvas) { canvas.drawColor(Color.WHITE); drawArcs(canvas, mBigOval, mUseCenters[mBigIndex], mPaints[mBigIndex]); for (int i = 0; i < 4; i++) { drawArcs(canvas, mOvals[i], mUseCenters[i], mPaints[i]); } mSweep += SWEEP_INC; if (mSweep > 360) { mSweep -= 360; mStart += START_INC; if (mStart >= 360) { mStart -= 360; } mBigIndex = (mBigIndex + 1) % mOvals.length; } invalidate();//动画形成关键 } } }
发表评论
-
图片处理
2012-11-28 02:48 0http://www.linuxidc.com/Linux/2 ... -
Api Demo - .graphics(24)>>Cube
2012-08-03 15:18 1150package com.example.android.api ... -
Api Demo - .graphics(24)>>TouchRotateActivity
2012-08-03 15:07 1039package com.example.android.api ... -
Api Demo - .graphics(23)>>CubeMapActivity
2012-07-31 16:31 1389package com.opengl.test; imp ... -
opengles 学习关键字
2012-07-24 09:35 638主动渲染、平面着色、透视投影、near、索引法、glLight ... -
Api Demo - .graphics(21)>>StaticTriangleRenderer
2012-07-23 17:51 1235package com.example.android.api ... -
Api Demo - .graphics(20)>>CompressedTextureActivity
2012-07-23 16:50 1367/* * Copyright (C) 2008 The A ... -
Api Demo - .graphics(19)
2012-07-20 22:45 722package com.example.android.api ... -
Api Demo - .graphics(18)
2012-07-20 10:32 818package com.example.android.api ... -
Api Demo - .graphics(17)
2012-07-19 11:43 933/* package com.example.andro ... -
Api Demo - .graphics(16)
2012-07-18 14:54 600package com.example.android.api ... -
Api Demo - .graphics(15)
2012-07-18 12:55 799package com.example.android.api ... -
Api Demo - .graphics(14)
2012-07-18 11:50 810package com.example.android.api ... -
Api Demo - .graphics(13)
2012-07-17 11:38 903//关键字 Paint,MaskFilte,Path,Xfer ... -
Api Demo - .graphics(12)
2012-07-17 10:44 651<?xml version="1.0" ... -
Api Demo - .graphics(11)
2012-07-17 09:53 784//关键字:Shader ,ShapeDrawable pa ... -
Api Demo - .graphics(10)
2012-07-16 17:59 1042/* * Copyright (C) 2008 The A ... -
Api Demo - .graphics(9)
2012-07-16 11:26 749//关键字:颜色合成,JPEG,PNG图片解压,Bitmap压 ... -
Api Demo - .graphics(8)
2012-07-16 10:43 651//关键字:ColorMatrixColorFilter; ... -
Api Demo - .graphics(7)
2012-07-16 09:53 736// 关键字:Porter-Duff package c ...
相关推荐
Microsoft.Maui.Graphics是完全使用C#针对iOS,Android,Windows,macOS,Tizen和Linux的跨平台图形库。 使用此库,您可以使用通用API来定位多个抽象,从而使您可以在平台之间共享绘图代码,或在单个应用程序内混合...
代码很短,但是找jar包找的欲仙欲死,包括commons-io-1.4.jar,commons-logging-1.1.1.jar,docx4j-3.3.3.jar,freemarker.jar,google-collections.jar,log4j-1.2.8....xalan-2.7.0.jar,xmlgraphics-commons-1.3.jar
ArcGIS API for iOS 使您可使用 Objective C 构建多种应用程序(这些应用程序将运用 ArcGIS Server 提供的强大制图、地理编码、地理处理和自定义功能)并将它们部署到 Apple iPhone、iPod Touch 和 iPad 设备。API ...
WebGL Audio API for 3D Graphics in Three.JS by Igor Fortel 6 pages pdf short paper with a small demo
很多的官方demo,api,超值的啊。 animation ApiDemos.java ApiDemosApplication.java app appwidget content graphics media os text view
:示例代码介绍了如何使用API和遮挡剔除的可配置项。 :该示例代码提供了供离线超分辨率插件参考或使用的程序。 :该示例代码提供了可供参考或使用插件的程序。 有关更多信息,您可以在每个样本中检出README...
2. Installing the ros-by-example Code...............................................................3 3. Task Execution using ROS..........................................................................
安卓开发例程,内置图形界面开发 硬件开发 nfc 媒体应用开发等官方demo
TDBProgress displays BDE operations progress for IDAPI drivers that support callback-functions. TDBIndexCombo is a visual interface component that provides your end- users with an easy means of ...
Initialization....................................................................17 Section 2: Enter Game Loop............................................................17 Section 3: Retrieve ...
围绕Unity新的实验性Vector API的简单包装,让您就像在HTML5画布中一样进行绘制。 演示基本的填充,笔触和填充规则。 例如: m_Graphics.MoveTo(900, 150);m_Graphics.BezierCurveTo(910, 250, 940, 250, 950, 250);...
android API demo 包括accessibility animation app content graphics media nfc os preference ...
API: MovieEvent()和draw()函数的调用速度不同。 因此,最好在MovieEvent()中进行所有帧处理。 或者,您可以首先保存所有帧,然后将它们作为图像文件顺序加载到draw()中。 删除背景的示例:chp16 / example...
2. Introducing the JavaMail API 3 3. Reviewing related protocols 4 4. Installing JavaMail 6 5. Reviewing the core classes 8 6. Using the JavaMail API 13 7. Searching with SearchTerm 21 8. ...
8.3.2012 - WPTools 6.25.3' - borders for paragraphs with multiple lines were not drawn correctly - change in DBWPRich.pas to use LoadFromString instead of Text - fix possible range check error - ...
这是一个自己整理的详细的英文Raphael 2.2参考文档,压缩包内包含pdf参考文档《Learning Raphael JS Vector Graphics》和示例demo。
RX Library 2.75 =============== The Set of Native Delphi Components for Borland Delphi versions 1, 2, 3, 4 & 5 and Borland C++ Builder 1, 3 & 4. ...5. A couple of simple demo applications.
- Added support for VGA graphics mode with 400 lines (partial fix for SF bug #2948724) - NE2K: Fixed "send buffer" command issue on big endian hosts - USB - converted common USB code plus devices ...
7.12.3. 可能遭遇的MVC异常 7.13. 从以前的版本移植 7.13.1. 从 1.0.x 到 1.5.0 或更新的版本的移植 7.13.2. 从 0.9.3 到 1.0.0RC1 或更新的版本的移植 7.13.3. 从 0.9.2 移植到 0.9.3 或更新的版本 7.13.4. 从...
as an interval value), and will provide Up and/or Dn graphics to enable navigation between the menu sections.<END><br>40 , CoolExplorer2.zip The new and improved Cool Explorer: Many new functions....