public Bitmap drawTextToBitmap(Context mContext, int resourceId, String mText) {
try {
Resources resources = mContext.getResources();
float scale = resources.getDisplayMetri...
分类:
其他好文 时间:
2014-07-18 21:23:53
阅读次数:
258
竖直拍照if (Integer.parseInt(Build.VERSION.SDK) >= 8) { camera.setDisplayOrientation(90); } else { if (getResources().getConfiguration().ori...
分类:
移动开发 时间:
2014-07-17 14:34:49
阅读次数:
252
一直接触这些东西,还是归个类整理一下比较好。Resource -> DrawableDrawable draw1 = this.getResources().getDrawable(R.drawable.icon);Drawable -> Bitmap1.static Bitmap drawable...
分类:
其他好文 时间:
2014-07-17 10:11:04
阅读次数:
161
Locale locale = getResources().getConfiguration().locale;
String language = locale.getLanguage();
以上代码可以获取到当前系统的语言码,中文的语言码为ch,英文的语言码为en,完整的语言码如下:
bn_BD孟加拉语(孟加拉)
bo_CN 博多语(中国)
bo_IN 博多语(印度)
...
分类:
移动开发 时间:
2014-07-16 11:03:31
阅读次数:
228
1、代码中设置drawableTopTextView textView = new TextView(getActivity());Drawable drawable = getResources().getDrawable(R.drawable.home_1);drawable.setBounds...
分类:
其他好文 时间:
2014-07-11 22:33:46
阅读次数:
223
I:画圆角: 1 private void roundImg(ImageView iv){ 2 3 /**本地资源*/ 4 5 InputStream is = getResources().openRawResource(R.drawable.icon); 6 7 Bitma...
分类:
移动开发 时间:
2014-06-28 12:52:59
阅读次数:
311
1.Bitmap转换为图片字符串Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);ByteArrayOutputStream outputStream = new ByteArra...
分类:
移动开发 时间:
2014-06-24 09:35:04
阅读次数:
503
Bitmap bitmap=((BitmapDrawable)getResources().getDrawable(R.drawable.pull_down_color)).getBitmap();
Matrix matrix=new Matrix();
matrix.postRotate(180);
bitmap=Bitmap.create...
分类:
其他好文 时间:
2014-06-22 22:50:07
阅读次数:
206
今天做一个Android的刮刮乐项目,里面用到很多的地方用到了getResources。
// 获得图片
//参数1:res是资源的引用,参数2:id是图片的id
after = BitmapFactory.decodeResource(getResources(), R.drawable.b);
before = BitmapFactory.decodeResource(get...
分类:
移动开发 时间:
2014-06-22 22:15:06
阅读次数:
278
一是可以通过Java的String.format(String format, Object... args)方法来实现二则是通过Android自带的getResources().getString(int id, Object... formatArgs)实现占位符的语法可以参考Java文档简单演...
分类:
移动开发 时间:
2014-06-21 07:47:46
阅读次数:
248