请问各路大神,android 如何判断相册图片是横向还是纵向?android 相册图片横向纵向
解决方案 »
- 【求解惑】ERROR Error parsing XML: unbound prefix
- Android图片点击效果如何实现?
- 关于setShortcut
- 如何将一个Bitmap通过程序保存到sdcard上面
- 关于view下面的invalidate函数
- 求:网络实时视频流
- 请大侠提供一个Android中显示ppt的解决办法.
- 怎样把一个网站做成android客户端?
- 通过智能手机外接一个usb UVC的开发板,远程监控【事成有报酬】
- android中Handler有无run方法的区别
- FileDescriptor.sync怎么用?
- Android 2.3写文件问题(4.0可行,快崩溃了,求大神!)
http://developer.android.com/reference/android/app/Activity.html#getRequestedOrientation()三个参数
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
if (rotation != 0) {
Bitmap bitmap = BitmapFactory.decodeFile(path);
imageBefore.setImageBitmap(bitmap);
Matrix m = new Matrix();
m.setRotate(rotation);
Bitmap transformed = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m, true);
return transformed;
}这个方法里的c是什么?
用这个方法获取到orientation可以吗?
用这个方法获取到orientation可以吗?ExifInterface exifInterface = new ExifInterface(s);
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1);
//int rotation = c.getInt(getColumnIndex(MediaStore.Images.ImageColumns.ORIENTATION));
if (orientation != 0) {
im = new ImageView(this);
bm = BitmapFactory.decodeFile(s, opts);
im.setImageBitmap(bm);
Matrix m = new Matrix();
m.setRotate(orientation);
Bitmap transformed = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), m, true);
}
能帮我看看这样写行吗?这不是用cursor获取的图片,我实在是没辙了