Surface 怎么进行surface pro4屏幕截图图

请注意,是窗口截屏,而不是全屏幕截屏。同时按右侧的Windows标和音量减可以全屏幕截屏,这个明白,但如何截窗口呢?在普通键盘上,按Print Screen键(一般显示为Prt Scm,如下图)就可以全屏幕截屏,按Alt+Prt Scm就可以只截取当前的高亮窗口。但是SP3的键盘上没有这个键,请问有没有哪位高人知道如何截取窗口?可千万别告诉我先截全屏再自己裁剪啊。补充下找到的最佳答案:全屏幕截屏:Fn+Space,如果有扩展显示器的话,扩展显示器也会被截屏,跟双击手写笔的紫色键效果是一样的窗口截屏:Fn+Alt+Space,只截屏当前被激活的窗口
不需要按Win键
全屏截图是Fn+Space窗口截图是Fn+Alt+Space
已有帐号?
无法登录?
社交帐号登录
答案里放二维码一律反对+没有帮助Surface 怎么进行屏幕截图_百度知道
Surface 怎么进行屏幕截图
即可截取图片。蓝牙连接Surface Pen之后直接截图,即可直接截图,双击笔尾端的按钮,先按住Win徽标键。截图保存在这台电脑-图片-屏幕截图中。用手写笔Surface Pen截图。比如用搜狗输入法截图插件等软件进行截图。直接按PrtScn键。键盘截图。应用软件截图,可以在Word文档等地粘贴图片,再按音量下键
其他类似问题
为您推荐:
屏幕截图的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁[Android应用开发]-(13)屏幕截图功能--截取全屏,无需Root(附源码)
由于要做说明书,或者给客户看效果图,不得不通过截图的方式把屏幕接下来(当然了,还可以通过拍照来达到目的)。于是就Google找到一些需要Root权限,和不需要Root权限的截图应用,有些失望,多数不可用。于是就想自己开发一个截图的应用。在View 中提供一个getDrawingCache的方法,可以通过次方法获取View的截屏,但仅仅是截取View的。如果要截取状态栏呢?
&&& 其实不然,在ICS中的SystemUI就实现了截图的功能,按组合键Power+Volume Add/Volume sub就能截取图片。代码目录:
frameworks/base/packages/SystemUI/src/com/android/systemui/screenshot/在此目录下就两个文件,主要的截图方法在GlobalScreenshot中,本文就通过移植SystemUI中截图的代码实现截图功能。
&&& 首先是直接移植SystemUI的代码,实现截图效果,这部分的代码就不贴出来了,直接去代码吧, 关键的代码没有几句,最最主要的是:Surface.screenshot(),请看代码吧。
&SPAN style=&FONT-SIZE: 16px&&package org.winplus.&
import java.io.F&
import java.io.FileNotFoundE&
import java.io.FileOutputS&
import java.io.IOE&
import java.text.SimpleDateF&
import java.util.D&
import android.app.A&
import android.content.C&
import android.graphics.B&
import android.graphics.C&
import android.graphics.M&
import android.os.B&
import android.util.DisplayM&
import android.util.L&
import android.view.D&
import android.view.S&
import android.view.WindowM&
import android.os.SystemP&
public class SimpleScreenshotActivity extends Activity {&
&&& private Display mD&
&&& private WindowManager mWindowM&
&&& private DisplayMetrics mDisplayM&
&&& private Bitmap mScreenB&
&&& private Matrix mDisplayM&
&&& @Override&
&&& public void onCreate(Bundle savedInstanceState) {&
&&&&&&& super.onCreate(savedInstanceState);&
&&&&&&& setContentView(R.layout.main);&
&&&&&&& new Thread(new Runnable() {&
&&&&&&&&&&& @Override&
&&&&&&&&&&& public void run() {&
&&&&&&&&&&&&&&& takeScreenshot();&
&&&&&&&&&&& }&
&&&&&&& }).start();&
&&& private float getDegreesForRotation(int value) {&
&&&&&&& switch (value) {&
&&&&&&& case Surface.ROTATION_90:&
&&&&&&&&&&& return 360f - 90f;&
&&&&&&& case Surface.ROTATION_180:&
&&&&&&&&&&& return 360f - 180f;&
&&&&&&& case Surface.ROTATION_270:&
&&&&&&&&&&& return 360f - 270f;&
&&&&&&& }&
&&&&&&& return 0f;&
&&& private void takeScreenshot() {&
&&&&&&& mWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);&
&&&&&&& mDisplay = mWindowManager.getDefaultDisplay();&
&&&&&&& mDisplayMetrics = new DisplayMetrics();&
&&&&&&& mDisplay.getRealMetrics(mDisplayMetrics);&
&&&&&&& mDisplayMatrix = new Matrix();&
&&&&&&& float[] dims = { mDisplayMetrics.widthPixels,&
&&&&&&&&&&&&&&& mDisplayMetrics.heightPixels };&
&&&&&&& int value = mDisplay.getRotation();&
&&&&&&& String hwRotation = SystemProperties.get(&ro.sf.hwrotation&, &0&);&
&&&&&&& if (hwRotation.equals(&270&) || hwRotation.equals(&90&)) {&
&&&&&&&&&&& value = (value + 3) % 4;&
&&&&&&& }&
&&&&&&& float degrees = getDegreesForRotation(value);&
&&&&&&& boolean requiresRotation = (degrees & 0);&
&&&&&&& if (requiresRotation) {&
&&&&&&&&&&& // Get the dimensions of the device in its native orientation&&
&&&&&&&&&&& mDisplayMatrix.reset();&
&&&&&&&&&&& mDisplayMatrix.preRotate(-degrees);&
&&&&&&&&&&& mDisplayMatrix.mapPoints(dims);&
&&&&&&&&&&& dims[0] = Math.abs(dims[0]);&
&&&&&&&&&&& dims[1] = Math.abs(dims[1]);&
&&&&&&& }&
&&&&&&& mScreenBitmap = Surface.screenshot((int) dims[0], (int) dims[1]);&
&&&&&&& if (requiresRotation) {&
&&&&&&&&&&& // Rotate the screenshot to the current orientation&&
&&&&&&&&&&& Bitmap ss = Bitmap.createBitmap(mDisplayMetrics.widthPixels,&
&&&&&&&&&&&&&&&&&&& mDisplayMetrics.heightPixels, Bitmap.Config.ARGB_8888);&
&&&&&&&&&&& Canvas c = new Canvas(ss);&
&&&&&&&&&&& c.translate(ss.getWidth() / 2, ss.getHeight() / 2);&
&&&&&&&&&&& c.rotate(degrees);&
&&&&&&&&&&& c.translate(-dims[0] / 2, -dims[1] / 2);&
&&&&&&&&&&& c.drawBitmap(mScreenBitmap, 0, 0, null);&
&&&&&&&&&&& c.setBitmap(null);&
&&&&&&&&&&& mScreenBitmap =&
&&&&&&& }&
&&&&&&& // If we couldn't take the screenshot, notify the user&&
&&&&&&& if (mScreenBitmap == null) {&
&&&&&&&&&&&&
&&&&&&& }&
&&&&&&& // Optimizations&&
&&&&&&& mScreenBitmap.setHasAlpha(false);&
&&&&&&& mScreenBitmap.prepareToDraw();&
&&&&&&& try {&
&&&&&&&&&&& saveBitmap(mScreenBitmap);&
&&&&&&& } catch (IOException e) {&
&&&&&&&&&&& System.out.println(e.getMessage());&
&&&&&&& }&
&&& public void saveBitmap(Bitmap bitmap) throws IOException {&
&&&&&&& String imageDate = new SimpleDateFormat(&yyyy-MM-dd-HH-mm-ss&)&
&&&&&&&&&&&&&&& .format(new Date(System.currentTimeMillis()));&
&&&&&&& File file = new File(&/mnt/sdcard/Pictures/&+imageDate+&.png&);&
&&&&&&& if(!file.exists()){&
&&&&&&&&&&& file.createNewFile();&
&&&&&&& }&
&&&&&&& FileOutputS&
&&&&&&& try {&
&&&&&&&&&&& out = new FileOutputStream(file);&
&&&&&&&&&&& if (pressFormat.PNG, 70, out)) {&
&&&&&&&&&&&&&&& out.flush();&
&&&&&&&&&&&&&&& out.close();&
&&&&&&&&&&& }&
&&&&&&& } catch (FileNotFoundException e) {&
&&&&&&&&&&& e.printStackTrace();&
&&&&&&& } catch (IOException e) {&
&&&&&&&&&&& e.printStackTrace();&
&&&&&&& }&
package org.winplus.
import java.io.F
import java.io.FileNotFoundE
import java.io.FileOutputS
import java.io.IOE
import java.text.SimpleDateF
import java.util.D
import android.app.A
import android.content.C
import android.graphics.B
import android.graphics.C
import android.graphics.M
import android.os.B
import android.util.DisplayM
import android.util.L
import android.view.D
import android.view.S
import android.view.WindowM
import android.os.SystemP
public class SimpleScreenshotActivity extends Activity {
&private Display mD
&private WindowManager mWindowM
&private DisplayMetrics mDisplayM
&private Bitmap mScreenB
&private Matrix mDisplayM
&@Override
&public void onCreate(Bundle savedInstanceState) {
&&super.onCreate(savedInstanceState);
&&setContentView(R.layout.main);
&&new Thread(new Runnable() {
&&&@Override
&&&public void run() {
&&&&takeScreenshot();
&&}).start();
&private float getDegreesForRotation(int value) {
&&switch (value) {
&&case Surface.ROTATION_90:
&&&return 360f - 90f;
&&case Surface.ROTATION_180:
&&&return 360f - 180f;
&&case Surface.ROTATION_270:
&&&return 360f - 270f;
&&return 0f;
&private void takeScreenshot() {
&&mWindowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
&&mDisplay = mWindowManager.getDefaultDisplay();
&&mDisplayMetrics = new DisplayMetrics();
&&mDisplay.getRealMetrics(mDisplayMetrics);
&&mDisplayMatrix = new Matrix();
&&float[] dims = { mDisplayMetrics.widthPixels,
&&&&mDisplayMetrics.heightPixels };
&&int value = mDisplay.getRotation();
&&String hwRotation = SystemProperties.get(&ro.sf.hwrotation&, &0&);
&&if (hwRotation.equals(&270&) || hwRotation.equals(&90&)) {
&&&value = (value + 3) % 4;
&&float degrees = getDegreesForRotation(value);
&&boolean requiresRotation = (degrees & 0);
&&if (requiresRotation) {
&&&// Get the dimensions of the device in its native orientation
&&&mDisplayMatrix.reset();
&&&mDisplayMatrix.preRotate(-degrees);
&&&mDisplayMatrix.mapPoints(dims);
&&&dims[0] = Math.abs(dims[0]);
&&&dims[1] = Math.abs(dims[1]);
&&mScreenBitmap = Surface.screenshot((int) dims[0], (int) dims[1]);
&&if (requiresRotation) {
&&&&&&&&&&& // Rotate the screenshot to the current orientation
&&&&&&&&&&& Bitmap ss = Bitmap.createBitmap(mDisplayMetrics.widthPixels,
&&&&&&&&&&&&&&&&&&& mDisplayMetrics.heightPixels, Bitmap.Config.ARGB_8888);
&&&&&&&&&&& Canvas c = new Canvas(ss);
&&&&&&&&&&& c.translate(ss.getWidth() / 2, ss.getHeight() / 2);
&&&&&&&&&&& c.rotate(degrees);
&&&&&&&&&&& c.translate(-dims[0] / 2, -dims[1] / 2);
&&&&&&&&&&& c.drawBitmap(mScreenBitmap, 0, 0, null);
&&&&&&&&&&& c.setBitmap(null);
&&&&&&&&&&& mScreenBitmap =
&&&&&&& // If we couldn't take the screenshot, notify the user
&&&&&&& if (mScreenBitmap == null) {
&&&&&&&&&&&
&&&&&&& // Optimizations
&&&&&&& mScreenBitmap.setHasAlpha(false);
&&&&&&& mScreenBitmap.prepareToDraw();
&&&saveBitmap(mScreenBitmap);
&&} catch (IOException e) {
&&&System.out.println(e.getMessage());
&public void saveBitmap(Bitmap bitmap) throws IOException {
&&String imageDate = new SimpleDateFormat(&yyyy-MM-dd-HH-mm-ss&)
&&&&.format(new Date(System.currentTimeMillis()));
&&File file = new File(&/mnt/sdcard/Pictures/&+imageDate+&.png&);
&&if(!file.exists()){
&&&file.createNewFile();
&&FileOutputS
&&&out = new FileOutputStream(file);
&&&if (pressFormat.PNG, 70, out)) {
&&&&out.flush();
&&&&out.close();
&&} catch (FileNotFoundException e) {
&&&e.printStackTrace();
&&} catch (IOException e) {
&&&e.printStackTrace();
PS:1、需要在Manifest.xml中加入代码:android:sharedUserId=&android.uid.system&
&&&&&&&& 2、由于调用了@hide的API,所以编译得时候请使用makefile编译。或者通过在Eclipse中添加Jar文件通过编译。
&&&&&&&& 3、此代码只在Android4.0中使用过,2.3的就没去做测试了。
&作者:tangcheng_ok
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'Service Unavailable
Service Unavailable
HTTP Error 503. The service is unavailable.

我要回帖

更多关于 surface pro 屏幕截图 的文章

 

随机推荐