Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Java
- varags
- Redirect
- 안드로이드
- Web Service
- 웹 서비스
- STS
- html
- Bootstrap
- 이클립스
- scrollView
- javascript
- TextBox
- decompiler
- 컬럼명
- 웹뷰
- Apache Lucene
- asp.net
- 자바
- C#
- MSsql
- Android
- SpringSource Tool Suite
- jsp
- Maven
- MANTIS
- Eclipse
- 자바스크립트
- MS-SQL
- WebView
Archives
- Today
- Total
bboks.net™
이미지 flip 시키기 본문
1. 플립 메소드
public static final int FLIP_VERTICAL = 1; public static final int FLIP_HORIZONTAL = 2; private Bitmap flipImage(Bitmap src, int type) { // create new matrix for transformation Matrix matrix = new Matrix(); // if vertical if (type == FLIP_VERTICAL) { // y = y * -1 matrix.preScale(1.0f, -1.0f); } // if horizonal else if (type == FLIP_HORIZONTAL) { // x = x * -1 matrix.preScale(-1.0f, 1.0f); // unknown type } else { return null; } // return transformed image return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true); }
2. 이미지 플립 시키미(호출쪽)
ImageView imgView = (ImageView) findViewById(R.id.imageView); imgView.setImageBitmap(flipImage(BitmapFactory.decodeResource(getResources(), R.drawable.img), FLIP_VERTICAL );