资源简介
这份源码实现的是Android图片编辑中出现的在图片上涂鸦的的功能,Edit_bitmap为传递到该界面的参数

代码片段和文件信息
package com.example.jump;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.onclickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
public class ScrawlActivity extends Activity {
/** Called when the activity is first created. */
private Paint mPaint=null;
private LinearLayout linear=null;
private TouchView touchView=null;
private Button clearButton=null;
private Button confirmButton=null;
private Button cancelButton=null;
private Button colorview=null;
private Button []colorButton=null;
private final int colorcount=7;
private int COUNT=0;
private SeekBar mseekBar=null;
private int []colorArray={Color.YELLOWColor.BLACKColor.WHITEColor.GREENColor.GRAYColor.REDColor.BLUE};
DisplayMetrics dm = new DisplayMetrics();
int screenwidth = 0;
int screenheight =0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.scrawl);
getWindowManager().getDefaultDisplay().getMetrics(dm);
screenwidth = (int)(dm.widthPixels);
screenheight = (int)(dm.heightPixels);
confirmButton=(Button)findViewById(R.id.confirm);
cancelButton=(Button)findViewById(R.id.cancel);
clearButton=(Button)findViewById(R.id.clear);
linear = (LinearLayout) findViewById(R.id.linear);
colorButton=new Button[colorcount];
int []colorButtonID={R.id.yellowR.id.blackR.id.whiteR.id.greenR.id.grayR.id.redR.id.blue};
colorview=(Button)findViewById(R.id.color);
colorview.setBackgroundColor(Color.RED);
for(int i=0;i colorButton[i]=(Button)findViewById(colorButtonID[i]);
colorButton[i].setBackgroundColor(colorArray[i]);
}
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setDither(true);
mPaint.setColor(Color.GREEN);
mPaint.setstyle(Paint.style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(2);
mseekBar=(SeekBar)findViewById(R.id.mseekBar);
mseekBar.setMax(30);
mseekBar.setProgress(15);
for(int i=0;i colorButton[i].setonclickListener(new View.onclickListener() {
private int colors=colorArray[COUNT];
public void onclick(View v) {
// TODO Auto-generated method stub
mPaint.setColor(colors);
colorview.setBackgroundColor(colors);
}
});
COUNT++;
}
mseekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onProgressChanged(
SeekBar seekBar
int prog
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4074 2012-07-29 18:44 scrawl.xm
文件 1291 2012-07-29 16:24 strings.xm
文件 6242 2012-07-29 18:44 ScrawlActivity.java
----------- --------- ---------- ----- ----
11607 3
相关资源
- AndroidStudio版直连sqlserver
- android带百分比进度条的文件上传,使
- 美食天下项目Android版源码和Web版源码
- Android之自定义ToggleButton使用
- Android非常漂亮的登录界面
- pc与android通过usb socket实现手机通信
- android毕业设计
- 百度地图自定义Markerandroid
- Android分区工具包
- android-support-v4.jar已打包进去源代码
- u-blox_Android_GNSS_Driver_v3.10驱动源码+中
- 个人根据Android移动开发案例详解手写
- android 视频播放器 项目和原码
- Android【动画】【特效】 17种动画特效
- 基于Android智能家居详细设计(经典)
- android通过JDBC连接Mysql数据库
- Android通讯录的源代码
- android 瀑布流Demo
- 指纹传感器FPC1080在android下的驱动
- delphi xe5 android 调用照相机摄像头拍照
- Android手机连连看游戏源码
- android-sdk-windows v2.3离线完整版
- android 底部弹出菜单(带透明背景)
- Android工程模式简介.rar
- Android蓝牙和Cors网络开发源码
- Android powermanger wakelock
- Android v7的一些jar包
- 最新android supportV7包
- android图片压缩工具类分享
- 单机搭建Android(解决Network is unreach
评论
共有 条评论