|
|
|
[Android] อยากทราบวิธีการหมุนรูปที่เอามาแสดงจาก SD card ครับ ว่าใช้คำสั่งอะไร เขียนอย่างไง |
|
|
|
|
|
|
|
ลองดูครับ
Code (Android-Java)
Matrix minMatrix = new Matrix();
//height and width are set earlier.
Bitmap minBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas minCanvas = new Canvas(minBitmap);
int minwidth = bitmapMin.getWidth();
int minheight = bitmapMin.getHeight();
int centrex = minwidth/2;
int centrey = minheight/2;
minMatrix.setRotate(mindegrees, centrex, centrey);
Bitmap newmin = Bitmap.createBitmap(minBitmap, 0, 0, (int) minwidth, (int) minheight, minMatrix, true);
minCanvas.drawBitmap(newmin, (centrex - newmin.getWidth()/2), (centrey - newmin.getHeight()/2), null);
minCanvas.setBitmap(minBitmap);
http://stackoverflow.com/questions/5182861/android-rotation-of-image-around-the-center
|
|
|
|
|
Date :
2013-01-02 06:46:54 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|