码迷,mamicode.com
首页 >  
搜索关键字:getresources    ( 268个结果
Bitmap上写文字
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
Android camera 竖直拍照 获取竖直方向照片
竖直拍照if (Integer.parseInt(Build.VERSION.SDK) >= 8) { camera.setDisplayOrientation(90); } else { if (getResources().getConfiguration().ori...
分类:移动开发   时间:2014-07-17 14:34:49    阅读次数:252
简单谈谈Resource,Drawable和Bitmap之间的转换
一直接触这些东西,还是归个类整理一下比较好。Resource -> DrawableDrawable draw1 = this.getResources().getDrawable(R.drawable.icon);Drawable -> Bitmap1.static Bitmap drawable...
分类:其他好文   时间:2014-07-17 10:11:04    阅读次数:161
Android开发实用技巧:判断当前系统语言版本
Locale locale = getResources().getConfiguration().locale; String language = locale.getLanguage(); 以上代码可以获取到当前系统的语言码,中文的语言码为ch,英文的语言码为en,完整的语言码如下: bn_BD孟加拉语(孟加拉)  bo_CN 博多语(中国)  bo_IN 博多语(印度)  ...
分类:移动开发   时间:2014-07-16 11:03:31    阅读次数:228
TextView 常用摘要
1、代码中设置drawableTopTextView textView = new TextView(getActivity());Drawable drawable = getResources().getDrawable(R.drawable.home_1);drawable.setBounds...
分类:其他好文   时间:2014-07-11 22:33:46    阅读次数:223
【android】 圆角头像
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
android 将图片通过base64转换为String 将图片String转换为Bitmap
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()资源引用
今天做一个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
Android字符串中使用占位符
一是可以通过Java的String.format(String format, Object... args)方法来实现二则是通过Android自带的getResources().getString(int id, Object... formatArgs)实现占位符的语法可以参考Java文档简单演...
分类:移动开发   时间:2014-06-21 07:47:46    阅读次数:248
268条   上一页 1 ... 24 25 26 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!