public Bitmap scaleCenterCrop(Bitmap source, int newHeight, int newWidth) { int sourceWidth = source.getWidth(); int sourceHeight = source.getHeight(); // Compute the scaling factors to fit the new height and width, respectively. // To cover the final image, the final scaling will be the bigger // of these two. float xScale = (float) newWidth / sourceWidth; float yScale = (float) newHeight / sou..
안드로이드에서 이미지를 사용하기 위해서, 보통 Bitmap 클래스를 사용하게 됩니다. 안드로이드 앱에서 이미지에 대한 Thumbnail이나 이미지의 부분을 자르기 위해서는 Bitmap 클래스로 원하는 사이즈나 원하는 부분을 쉽게 잘라낼 수 있습니다. 아래의 BitmapUtil 클래스는, Bitmap 클래스를 이용해서 이미지를 줄이거나 늘리는 기능을 제공하는 유틸리티 클래스입니다. 아래의 기능정도면, 정말 특이한 요구사항(우측아래를 기준으로 100×100 이미지를 가져와라, 이런건 간단하게 아래의 cropCenter 메쏘드를 약간 변경하면 쉽게 적용)이 없다면, 아래의 유틸리티 클래스만으로도 상당히 많은 부분을 커버할 수 있을것 같습니다. import android.graphics.Bitmap; /** *..
- crop 커스텀 하기 좋은거 https://github.com/jdamcd/android-crop - 심플하고 카메라 or 갤러리 선택가능 https://github.com/lorensiuswlt/AndroidImageCrop - crop이랑 rotation 기능 같이 있음 https://github.com/Jhuster/ImageCropper - 아직 안해봄 https://github.com/lvillani/android-cropimage - 아직안해봄 (카메라 or 갤러리 선택가능한거 같은데 커스텀이 가능한듯 ) https://github.com/ryanhoo/PhotoCropper - 멀티픽 actionbar 이용한듯 ? https://github.com/giljulio/android-multi..
/** * Process가 실행중인지 여부 확인. * @param context, packageName * @return true/false */ public static boolean isRunningProcess(Context context, String packageName) { boolean isRunning = false; ActivityManager actMng = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE); List list = actMng.getRunningAppProcesses(); for(RunningAppProcessInfo rap : list) { if(rap.processName.equals(packag..
클래스를 만들어서 사용 public class SharedPreferenceHelper { private final String PREF_NAME = "com.test.pref"; public final static String ID = "PREF_TEST_ID"; public final static String PW = "PREF_TEST_PW"; static Context mContext; public SharedPreferenceHelper(Context c) { mContext = c; } public void put(String key, String value) { SharedPreferences pref = mContext.getSharedPreferences(PREF_NAME, Activit..
- Total
- Today
- Yesterday
- 봄봄봄
- xcode8
- git flow
- gitgub
- resize
- serialize
- keyboard
- 휴게소
- custom font
- cocoapods
- 킹스맨
- Re:NK
- 남자화장품
- ListView
- 가평휴게소
- 리엔케이
- 안드로이드 라이브러리
- 엘지
- crop
- Android
- 코드 하이라이트
- ios
- ShardPreferenes
- 참나무숯불닭갈비
- 안드로이드
- 아이콘 사이즈
- Xcode
- 막국수
- android jar
- xcode7
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |