이미지 » Api
getorientation
Description
이미지의 orientation값을 반환하는 API이다.
Parameters
Parameters |
Type |
Description |
strCallbackFunc |
STRING |
orientation 값을 구한 후 호출될 함수명 |
strImgUrl |
STRING |
[옵션] 이미지 url 혹은 이미지의 base64 인코딩 데이터 |
Return Value
Type |
Description |
BOOL |
정상 처리 여부 |
Remark
* 함수의 프로토타입은 아래와 같다.
// objInst [Instance] : 컴포넌트 인스턴스
// strImgUrl [String] : 대상 이미지의 url
// nOrientation [Int] : 이미지의 orientation값
// -1: 이미지에 orientation 값이 없는 경우
// -2: 이미지가 jpg 파일 형식이 아닌경우
// -3: 이미지를 로드하지 못했을 경우
function getorientation_callback(objInst, strImgUrl, nOrientation) { }
이미지의 확장자가 jpg일 경우 동작한다.
Example
function btn_rotate_on_mouseup(objInst)
{
imgOri.getorientation("getorientation_callback");
}
function getorientation_callback(objInst, strImgUrl, nOrientation){
var nRotateDeg;
// IE환경일 경우만 회전한다.
if (!factory.isie()) {
screen.alert("Not Internet Explorer");
return;
}
switch(nOrientation) {
case 1: nRotateDeg = 0; break;
case 3: nRotateDeg = 180; break;
case 6: nRotateDeg = 90; break;
case 8: nRotateDeg = 270; break;
}
// 이미지 회전
imgOri.setimagerotate(nRotateDeg, false);
}
Viewer Ver.
9.1.1.1
Update Date
20210512