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 | 29 | 30 |
Tags
- level1
- 동적웹페이지
- androidstudio
- 코딩테스트연습
- Fullcalendar
- 스킬체크
- 연습문제
- 안드로이드
- bootstrap
- Node
- 스킬체크테스트
- 부트스트랩
- Android
- REACT
- 프로그래머스
- bootstrapModal
- java
- AJAX
- 코딩테스트
- MSSQL
- php
- modal
- SimpleDateFormat
- Programmers
- Summer/WinterCoding
- 백준
- 월간코드챌린지시즌2
- 월간코드챌린지시즌3
- 모달
- 나머지가1
Archives
- Today
- Total
개발하는 고양이 오이
1. [Android_Java] 이미지 확대, 축소 하는 방법(PhotoView) 본문
안드로이드 스튜디오에서 이미지를 확대 및 축소하는 방법으로 라이브러리를 이용할 수 있습니다.


-------------------------------------------------------------------------------------------------------------------------
https://github.com/Baseflow/PhotoView
① build.gradle(Project: 프로젝트 이름) - maven {url "https://jitpack.io"} 추가

② build.gradle(Module: 프로젝트 이름.app) - implementation 'com.github.chrisbanes:PhotoView:2.1.3’ 추가

③ XML 코드 (iv_photo_zoom_in_out.xml)

<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/pv_photo"
android:layout_width="match_parent"
android:layout_height="match_parent" />
④ JAVA 코드

setContentView(R.layout.iv_photo_zoom_in_out);
PhotoView iv_photo = findViewById(R.id.pv_photo);
// 1.
iv_photo.setImageResource(R.drawable.btn_imgsize_dn); // 'btn_imgsize_dn' 대신 본인 코드의 drawable 파일 사용
// 2. bitmap 사용 시
iv_photo.setImageBitmap(bitmap);
감사합니다. ( ´●ᗜ●`*)