2010-05-18 7 views

답변

3

이미지 크기 조정은 이미지가 패키지되거나 네트워크 또는 파일 시스템을 통해 제공되는 경우에 충분합니다.

public EncodedImage scaleImage(EncodedImage source, int requiredWidth, int requiredHeight) { 
    int currentWidthFixed32 = Fixed32.toFP(source.getWidth()); 
    int requiredWidthFixed32 = Fixed32.toFP(requiredWidth); 
    int scaleXFixed32 = Fixed32.div(currentWidthFixed32, requiredWidthFixed32); 
    int currentHeightFixed32 = Fixed32.toFP(source.getHeight()); 
    int requiredHeightFixed32 = Fixed32.toFP(requiredHeight); 
    int scaleYFixed32 = Fixed32.div(currentHeightFixed32, requiredHeightFixed32); 
    return source.scaleImage32(scaleXFixed32, scaleYFixed32); 
} 

이미지 크기가 너비와 높이에 따라 조정됩니다. 파일 시스템 또는 persistentStorage을 :

+0

보기? – bryanallott

+0

모든 종류의 다양한 시도 :이 웹 사이트의 많은 사람들 - 귀하의 솔루션을 시도 할 때까지 아무 것도 작동하지 않았습니다. 감사. – BonanzaDriver

관련 문제