首先在sdcard上放几张jpg格式的图片(美女图片)。。。不然效果出不来的 , 注意必须要美女的相片。如果你是女的 ,必须放csdn男会员的相片,不然效果也出不来

public class Main Activity   extends Activity {GestureDetector gesture;private static final String TAG = "B";
//  private List<Bitmap> bitmaps = new ArrayList<Bitmap>();;private List<String> filepathName = new ArrayList<String>();
//  private Bitmap bm;
//  private Matrix matrix;private Handler handler;private Runnable runnable;private static final String URL = "/sdcard";private static final String tempFile = "/sdcard/temp.txt";int mCenterX = 160;int mCenterY = 0;int i = 0;ImageView mImageView1;ImageView mImageView2;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);File file = new File(tempFile);if(!file.exists()){getFiles(URL);writeFile(tempFile,filepathName);}filepathName = readFile(tempFile);setContentView(R.layout.main);    FlingGuest sg = new FlingGuest(this);gesture = new GestureDetector(sg);mImageView1 = (ImageView) findViewById(R.id.image1);mImageView2 = (ImageView) findViewById(R.id.image2);mImageView1.setImageBitmap(BitmapFactory.decodeFile(filepathName.get(i)));}public void delFile(File file){if(file.exists()){file.delete();}}public void getFiles(String path){System.out.println(path);String filePath;String fileName;String extName;File file = new File(path);if(file.isDirectory()){File[] files = file.listFiles();for(File f:files){getFiles(f.getAbsolutePath());}}else{filePath = file.getAbsolutePath();fileName = file.getName();extName = fileName.substring(fileName.indexOf(".")+1);if(extName.equals("jpg")||extName.equals("bmp")||extName.equals("gif")||extName.equals("png")){filepathName.add(filePath);}}}public void leftMoveHandle() {Rotate3d leftAnimation = new Rotate3d(0, -90, 0, 0, mCenterX, mCenterY);Rotate3d rightAnimation = new Rotate3d(90, 0, 0.0f, 0.0f, mCenterX,mCenterY);leftAnimation.setFillAfter(true);leftAnimation.setDuration(1000);rightAnimation.setFillAfter(true);rightAnimation.setDuration(1000);mImageView1.setImageBitmap(BitmapFactory.decodeFile(filepathName.get(i)));if(i==filepathName.size()-1){i = -1;}i++;mImageView2.setImageBitmap(BitmapFactory.decodeFile(filepathName.get(i)));mImageView1.startAnimation(leftAnimation);mImageView2.startAnimation(rightAnimation);}public void rightMoveHandle() {Rotate3d leftAnimation = new Rotate3d(0, 90, 0, 0, mCenterX, mCenterY);Rotate3d rightAnimation = new Rotate3d(-90, 0, 0.0f, 0.0f, mCenterX,mCenterY);leftAnimation.setFillAfter(true);leftAnimation.setDuration(1000);rightAnimation.setFillAfter(true);rightAnimation.setDuration(1000);mImageView1.setImageBitmap(BitmapFactory.decodeFile(filepathName.get(i)));if(i==0){i = filepathName.size();}i--;mImageView2.setImageBitmap(BitmapFactory.decodeFile(filepathName.get(i)));mImageView1.startAnimation(leftAnimation);mImageView2.startAnimation(rightAnimation);}// called automatically, any screen action will Triggered itpublic boolean onTouchEvent(MotionEvent me) {return gesture.onTouchEvent(me);}@Overrideprotected void onDestroy() {filepathName.clear();super.onDestroy();}public void writeFile(String file,List<String> list){try {FileWriter fw = new FileWriter(new File(file));for(String s :list){fw.write(s, 0, s.length());fw.write("=");}fw.flush();fw.close();} catch (IOException e) {e.printStackTrace();}}public List<String> readFile(String filepath){List<String> list = new ArrayList<String>();StringBuffer sb = new StringBuffer();String[] s ;try {FileReader fr = new FileReader(new File(filepath));int length = 0;while((length=fr.read())!=-1){sb.append((char)length);}s = sb.toString().split("=");for(int i=0;i<s.length;i++){list.add(s[i]);}} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}return list;}}

要demo的留下邮箱        或者http://download.csdn.net/source/3453268

3D相册 效果图如下相关推荐

  1. 使用html+css+js实现3D相册

    使用html+css+js实现3D相册,快来上传的照片吧 效果图: 代码如下,复制即可用: <!DOCTYPE html> <html lang="en"> ...

  2. ❤女朋友生日❤ HTML+css3+js 实现抖音炫酷樱花3D相册 (含背景音乐)程序员表白必备

    一年一度的/520/七夕情人节/女朋友生日/程序员表白,是不是要给女朋友或者正在追求的妹子一点小惊喜呢,今天这篇博客就分享下前端代码如何实现3D立体动态相册.赶紧学会了,来制作属于我们程序员的浪漫吧! ...

  3. 纯JS实现旋转木马/3d相册

    纯JavaScript实现 旋转木马/3d相册特效(鼠标拖拽旋转) 先来看看效果图 说一下实现的思路 旋转木马是通过依靠拥有景深(perspective)属性的盒子(此处盒子id起为:perspect ...

  4. ❤女朋友生日❤ HTML+css3+js 实现抖音炫酷樱花3D相册 (含背景音乐)程序员表白必备...

    一年一度的/520/七夕情人节/女朋友生日/程序员表白,是不是要给女朋友或者正在追求的妹子一点小惊喜呢,今天这篇博客就分享下前端代码如何实现3D立体动态相册.赶紧学会了,来制作属于我们程序员的浪漫吧! ...

  5. 抖音超火3D相册——魔方版(肖战壁纸图片)

    抖音超火3D相册--魔方版(肖战壁纸图片) 闲来无事,写了一个HTML5和CSS的肖战3D相册,以下奉上效果图和源代码. (PS:鼠标触碰可以显示内层六面体照片,拖动图片可以保存图片至本地.) 效果图 ...

  6. HTML实现3D相册

    今天,我给大家分享一个3D相册的代码 废话不说先上效果图: 先新建两个文件夹,一个叫css,另一个叫img,如下图: 先新建一个文本文档,输入下面的代码: <!DOCTYPE html> ...

  7. html5表白页面3d,七夕节表白3d相册制作(html5+css3)

    七夕节表白3d相册制作 涉及知识点 定位 阴影 3d转换 动画 主要思路: 通过定位将所有照片叠在一起,在设置默认的样式以及照片的布局,最后通过设置盒子以及照片的旋转动画来达到效果. 代码如下: 3d ...

  8. js和CSS3炫酷3D相册展示

    <!doctype html> <html> <head> <meta charset="UTF"> <title>js ...

  9. 3d相册 html 代码_女朋友生日,我送她网页相册,她感动的哭了(文中有惊喜)...

    女朋友生日,我送她网页相册,她感动的哭了(文中有惊喜) 导语: 女朋友最近生日,我作为浪漫(搞事)专家,怎么能不弄点惊喜呢?于是我的这一件礼物,直接把女朋友感动哭了. 我和女朋友的甜蜜聊天对话!! 那 ...

最新文章

  1. tracert路由跟踪工具使用方法
  2. 怎么用php制作会员注册表单,帝国CMS前台会员登陆表单的制作教程
  3. android百分比布局适配,安卓屏幕适配-百分比布局
  4. php 正则匹配内容,php读取、正则匹配邮件内容的方法
  5. php页面 info,通过PATH_INFO方法实现页面伪静态_php
  6. linux 目录/sys 解析
  7. backward理解
  8. oracle的redo与undio
  9. 彼尔盖茨的十句话,绝对让你改变一生
  10. [Unity3D]深度相机 Depth Camera
  11. ZOJ 3511 Cake Robbery
  12. mysql truncate耗时_线上MySQL 32G大小的表truncate所消耗的时间为2分钟,快还是慢?...
  13. 芯片(架构)顶会截稿时间和开会时间记录(ISSCC、VLSI、ISCA、HPCA、MICRO、DAC等)
  14. 易优EyouCMS全套插件使用说明
  15. iOS开发app打包
  16. 程序员因工资低拒绝offer,HR:估计你一辈子就是个程序员
  17. 一般云服务器支持多少并发,一般云服务器支持是多大并发?
  18. 一个项目的基本要素都有哪些?
  19. php输出圆周率100位,怎样使用JS实现计算圆周率到小数点后100位
  20. c4d文件库语言包帮助手册,C4D帮助文件的纰漏

热门文章

  1. 天空为什么刚才灰得就像哭过呢??
  2. adb自动化控制手机工具类
  3. 圣诞节的那些事(链接标签+路径)
  4. 开源社区普遍存在的几个观点之我见(1)开源的价值在哪里和(2)开源是不是商业...
  5. 中国学术会议2009---001
  6. 达梦DM8之使用dmmdf恢复误删除的undo/redo文件
  7. 【题解】Leyni,罗莉和队列(树状数组)
  8. linux文件赋予用户权限,Linux 给用户赋予操作权限
  9. SCCM2012软件分发
  10. 软件版本发布要求和标准