先看效果吧:
public class MainActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView imageView;
Matrix mMatrix = new Matrix();
imageView = (ImageView) findViewById(R.id.myimage);
Bitmap bmp = ((BitmapDrawable) getResources().getDrawable(
R.drawable.icon_150_380882090)).getBitmap();
Camera camera = new Camera();
camera.save();
camera.rotateY(50f);
//camera.rotateX(50f);
//camera.rotateZ(50f);
camera.getMatrix(mMatrix);
camera.restore();
Bitmap bm = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(),
bmp.getHeight(), mMatrix, true);
imageView.setImageBitmap(bm);
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/icon_150_380882090"/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="下图是改变后的效果" />
<ImageView
android:id="@+id/myimage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/icon_150_380882090"/>
</LinearLayout>
- 大小: 21 KB
分享到:
相关推荐
android.graphics.Color实践 Android 开发 使用了Color类
Android Graphics.Camera类的简单Demo 相应博文地址:http://blog.csdn.net/u011268102/article/details/9707265
android.graphics包是核心渲染包,它提供了一些初级图形工具,诸如画布、颜色过滤器、画笔等,可以让你直接在屏幕上进行图像处理
android graphics.rar android graphics.rar android graphics.rar
android.graphics包.pdf
NULL 博文链接:https://yuanzhifei89.iteye.com/blog/1136651
打印窗体中的数据C#源代码e.Graphics.DrawString(label1.Text, new Font("宋体", 10, FontStyle.Regular), Brushes.Black, 260, 400); e.Graphics.DrawString(textBox1.Text, new Font("宋体", 10, FontStyle....
import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.os.Bundle; import ...
主要介绍了android.graphics.Matrix类,较为详细的分析了Matrix类矩阵与坐标运算的相关函数功能与使用注意事项,并结合实例形式分析了android.graphics.Matrix类具体使用方法,需要的朋友可以参考下
CRC.Fundamentals.of.Computer.Graphics.4th.Edition.2015 CRC.Fundamentals.of.Computer.Graphics.4th.Edition.2015
调色板展示android.support.v7.graphics.Palette示例应用程序。 解决大位图等问题,并使用库进行系统栏着色。截屏执照 Copyright 2014 Zhang HaiLicensed under the Apache License, Version 2.0 (the "License");...
Wrox.Game.and.Graphics.Programming.for.iOS.and.Android.with.OpenGL.ES.2.0.2012
《Game.and.Graphics.Programming.for.iOS.and.Android.with.OpenGL.ES.2.0.Feb.2012》书籍源码,iOS和android代码同时包含。采用7z压缩,zip压缩为65M。电子书在这里下载:...
[Mac.OS.X开发系列电子书].Quartz.2D.Graphics.For.Mac.OS.X.Developers.pdf )
Mathematics.for.3D.Game.Programming.and.Computer.Graphics.3rd.Edition
The.Cg.Tutorial.The.Definitive.Guide.to.Programmable.Real-Time.Graphics
分享Android测试程序,使用Graphics.Camera进行3d旋转。
android.support.graphics.pdf 支持基于 Android API 21 的 PDF 功能的 PDF 库。