2012-03-26 8 views
3

나는이 활동의 ​​모습을 이미지로 변환하고 이메일로 보내기를 원한다. 이미지를 우편으로 보낼 수는 있지만 어떻게 그 활동을 이미지로 만들 수 있습니까? 가능한가?활동을 이미지로 변환하는 방법

+1

SO 시도 - [http://stackoverflow.com/questions/3067586/how-to-capture-the-android-device-screen-content][1] [1] : http://stackoverflow.com/questions/3067586/how-to-capture-the-android-device-screen-content – karakuricoder

답변

2

트릭을 수행해야하는 기기의 스크린 샷을 프로그래밍 방식으로 찍을 수 있습니다. 이 SO answer을 살펴보고 시작해야합니다.

0

drawing cache을 캡처하여 앱의 다른보기를 Bitmap 개체로 렌더링 할 수 있습니다.

자세한 내용은 http://blog.neurolive.net/2010/11/385/을 참조하십시오. (위대한 튜토리얼 들으)

특히

private Bitmap getScreenViewBitmap(View v) { 
    v.setDrawingCacheEnabled(true); 

    // this is the important code :) 
    // Without it the view will have a dimension of 0,0 and the bitmap will be null   
    v.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), 
       MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); 
    v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight()); 

    v.buildDrawingCache(true); 
    Bitmap b = Bitmap.createBitmap(v.getDrawingCache()); 
    v.setDrawingCacheEnabled(false); // clear drawing cache 
} 

당신이에 관심이있을 것입니다 무슨 보인다. (그냥 최상위보기를 발견하고 비트 맵을 캡처하는이 방법을 사용)

관련 문제