編輯:關於Android編程
右轉
private void right() { // TODO Auto-generated method stub int bmpW = bm.getWidth() ; int bmpH = bm.getHeight() ; double scale =1 ; scaleW = (float)(scaleW*scale); scaleH = (float)(scaleH*scale); Matrix mt =new Matrix (); mt .postScale(scaleW, scaleH); mt.setRotate(curDegrees=curDegrees+5); Bitmap bitmap= Bitmap.createBitmap(bm, 0, 0, bmpW, bmpH, mt, true); iv.setImageBitmap(bitmap); }左轉
private void left() { int bmpW = bm.getWidth() ; int bmpH = bm.getHeight() ; double scale =1 ; scaleW = (float)(scaleW*scale); scaleH = (float)(scaleH*scale); Matrix mt =new Matrix (); mt .postScale(scaleW, scaleH); mt.setRotate(curDegrees=curDegrees-5); Bitmap bitmap= Bitmap.createBitmap(bm, 0, 0, bmpW, bmpH, mt, true); iv.setImageBitmap(bitmap); }縮小
private void small() { int width =bm.getWidth() ; int height = bm.getHeight() ; double scale = 0.8; scaleW= (float) (scale*scaleW) ; scaleH = (float) (scaleH*scale) ; Matrix mt =new Matrix (); mt.postScale(scaleW, scaleH); Bitmap resizebmp = Bitmap.createBitmap(bm,0,0,width,height,mt,true); iv.setImageBitmap(resizebmp); }
private void big() { int bmpW = bm.getWidth() ; int bmpH = bm.getHeight() ; double scale =1.25 ; scaleW = (float) (scaleW*scale) ; scaleH = (float) (scaleH * scale) ; Matrix mt = new Matrix () ; mt.postScale(scaleW, scaleH) ; Bitmap bmp = Bitmap.createBitmap(bm, 0, 0, bmpW, bmpH, mt, true) ; iv.setImageBitmap(bmp); }
公司項目需要做推送,我們選擇用小米推送,經過一段時間的摸索,終於可以簡單的使用小米推送了。1.創建賬號登入後 登入後選擇消息推送:2.進入後創建項目,按照步驟創建完後如下
我們知道,ImageView有一個屬性叫做scaleType,它的取值一共有八種,分別是:matrix,fitXY,fitStart,fitCenter,fitEnd,c
如下圖。在Android上實現起來就不太容易,有些效果還是不如web端酷炫。)我們的Demo,Ac娘鎮樓(圖很渣,也忽略底下的SeekBar,這不是重點)一些動畫,效果錄
在apk中,有時候需要root權限,例如通過apk更新系統庫等system的文件等,避免升級固件,或者在apk中需要直接訪問某些設備等。下面是在apk中獲取root權限的