android动态壁纸---线条(6)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
float startY = newy1 / (4 - newz1 / 400);
float stopX = newx2 / (4 - newz2 / 400);
float stopY = newy2 / (4 - newz2 / 400);
c.drawLine(startX, startY, stopX, stopY, mPaint);
}
/*
* Draw a circle around the current touch point, if any.
*/
void drawTouchPoint(Canvas c) {
if (mTouchX >=0 && mTouchY >= 0) {
c.drawCircle(mTouchX, mTouchY, 80, mPaint);
}
}
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android "
package="com.mwongxming.LiveWall" android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<service android:label="@string/app_name" android:name=".ALiveWall"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper"
android:resource="@xml/alive_wall" />
</service>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
动态壁纸----线条
在原基础上进修了修改,一下贴出增加的代码:
private int x_point = 0;// 保存x坐标
private int y_point = 0;// 保存y坐标
private int height = 0;// 保存屏幕的长度
private int width = 0;// 保存屏幕的宽度
private int count;
private int i = 0;
效果实现代码:
mPaint.setAntiAlias(true);
mPaint.setColor(Color.BLUE);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>