Cocos2d-x截图实现
<a target=_blank id="L1" href="http://blog.csdn.net/linchaolong/article/details/44452205#L1" rel="#L1" style="text-decoration: none; color: rgb(12,137,207);"> 1</a> <a target=_blank id="L2" href="http://blog.csdn.net/linchaolong/article/details/44452205#L2" rel="#L2" style="text-decoration: none; color: rgb(12,207);"> 2</a> <a target=_blank id="L3" href="http://blog.csdn.net/linchaolong/article/details/44452205#L3" rel="#L3" style="text-decoration: none; color: rgb(12,207);"> 3</a> <a target=_blank id="L4" href="http://blog.csdn.net/linchaolong/article/details/44452205#L4" rel="#L4" style="text-decoration: none; color: rgb(12,207);"> 4</a> <a target=_blank id="L5" href="http://blog.csdn.net/linchaolong/article/details/44452205#L5" rel="#L5" style="text-decoration: none; color: rgb(12,207);"> 5</a> <a target=_blank id="L6" href="http://blog.csdn.net/linchaolong/article/details/44452205#L6" rel="#L6" style="text-decoration: none; color: rgb(12,207);"> 6</a> <a target=_blank id="L7" href="http://blog.csdn.net/linchaolong/article/details/44452205#L7" rel="#L7" style="text-decoration: none; color: rgb(12,207);"> 7</a> <a target=_blank id="L8" href="http://blog.csdn.net/linchaolong/article/details/44452205#L8" rel="#L8" style="text-decoration: none; color: rgb(12,207);"> 8</a> <a target=_blank id="L9" href="http://blog.csdn.net/linchaolong/article/details/44452205#L9" rel="#L9" style="text-decoration: none; color: rgb(12,207);"> 9</a> <a target=_blank id="L10" href="http://blog.csdn.net/linchaolong/article/details/44452205#L10" rel="#L10" style="text-decoration: none; color: rgb(12,207);"> 10</a> <a target=_blank id="L11" href="http://blog.csdn.net/linchaolong/article/details/44452205#L11" rel="#L11" style="text-decoration: none; color: rgb(12,207);"> 11</a> <a target=_blank id="L12" href="http://blog.csdn.net/linchaolong/article/details/44452205#L12" rel="#L12" style="text-decoration: none; color: rgb(12,207);"> 12</a> |
来自CODE的代码片
Cocos2d-x截图实现.cpp
Android下分享一张图片
Intent shareIntent = new Intent ( Intent . ACTION_SEND );//shareIntent.putExtra(Intent.EXTRA_TEXT,文本);File file = new File ( imgPath );if ( file . exists ()) {try {//一般情况下,保存的图片文件权限为rw- rw- rw-(外部可读写),但有的机型可能是rw- --- ---(外部不可读写),如果是后者会分享失败,因为外部不能读取这张图片。为了保证正常分享,需要通过chmod命令修改图片文件的权限。Process p = Runtime . getRuntime (). exec ( "chmod 644 " + imgPath );int status = p . waitFor (); //让当前线程等待if ( status == 0 ) { // 返回0表示正常终止Log . d ( TAG , "chmod succeed" );} else {Log . d ( TAG ,240)">"chmod failure" );}} catch ( Exception e ) {e . printStackTrace ();}Uri uri = Uri . fromFile ( file );shareIntent . putExtra ( Intent . EXTRA_STREAM , uri );shareIntent . setType ( "image/png" );startActivity ( Intent . createChooser ( shareIntent , getResources (). getText ( R . string . SHARE )));}