未验证 提交 d5fa8497 编写于 作者: O openharmony_ci 提交者: Gitee

!9427 master:display和screenshot开发指南下线:无需翻译

Merge pull request !9427 from 葛亚芳/master
......@@ -190,17 +190,10 @@
- [Agent-Powered Scheduled Reminder Development](notification/background-agent-scheduled-reminder-guide.md)
- [Debugging Assistant Usage](notification/assistant-guidelines.md)
- Window Manager
- Window
- [Window Overview](windowmanager/window-overview.md)
- [Application Window Development (Stage Mode)](windowmanager/application-window-stage.md)
- [Application Window Development (FA Model)](windowmanager/application-window-fa.md)
- [System Window Development (Stage Model Only)](windowmanager/system-window-stage.md)
- Display
- [Display Overview](windowmanager/display-overview.md)
- [Display Development](windowmanager/display-guidelines.md)
- Screenshot
- [Screenshot Overview](windowmanager/screenshot-overview.md)
- [Screenshot Development](windowmanager/screenshot-guidelines.md)
- [Window Overview](windowmanager/window-overview.md)
- [Application Window Development (Stage Mode)](windowmanager/application-window-stage.md)
- [Application Window Development (FA Model)](windowmanager/application-window-fa.md)
- [System Window Development (Stage Model Only)](windowmanager/system-window-stage.md)
- WebGL
- [WebGL Overview](webgl/webgl-overview.md)
- [WebGL Development](webgl/webgl-guidelines.md)
......
# Window Manager
* Window
* [Window Overview](window-overview.md)
* [System Window Development (Stage Model Only)](application-window-stage.md)
* [Application Window Development (FA Model)](application-window-fa.md)
* [Application Window Development (Stage Mode)](system-window-stage.md)
* Display
* [Display Overview](display-overview.md)
* [Display Development](display-guidelines.md)
* Screenshot
* [Screenshot Overview](screenshot-overview.md)
* [Screenshot Development](screenshot-guidelines.md)
- [Window Overview](window-overview.md)
- [System Window Development (Stage Model Only)](application-window-stage.md)
- [Application Window Development (FA Model)](application-window-fa.md)
- [Application Window Development (Stage Mode)](system-window-stage.md)
# Display Development
## When to Use
An application can obtain the default display object or all display objects by calling the **Display** APIs.
## Available APIs
For details about the APIs, see [Display](../reference/apis/js-apis-display.md).
## How to Develop
Call `getDefaultDisplay(): Promise<Display>` to obtain the default display object. An example code snippet is as follows:
```js
import display from '@ohos.display' // Import the module.
display.getDefaultDisplay().then((disp) => {
console.log('display.getDefaultDisplay success, display :' + JSON.stringify(disp));
}, (err) => {
console.log('display.getDefaultDisplay failed, error : ' + JSON.stringify(err));
})
```
# Display Overview
The **Display** APIs present the window layout of an application. The display attributes include the display ID, name, active status, state, refresh rate, rotation angle, width, height, pixel density, font scaling factor, and exact physical dots per inch.
## Basic Concepts
**Display**: a screen visible to an application. It can be used as a window container. It is an abstract concept that is different from a physical screen.
# Screenshot Development
## When to Use
You can specify a display device to take screenshots, with screenshot parameters specified.
## Available APIs
For details about the APIs, see [Screenshot](../reference/apis/js-apis-screenshot.md).
## How to Develop
Call **save(options?: ScreenshotOptions): Promise<image.PixelMap>** to take a screenshot. In this API, **options** is a predefined screenshot parameter. If **options** is unspecified, the entire screen is captured by default. An example code snippet is as follows:
```js
import screenshot from '@ohos.screenshot' // Import the module.
// Set screenshot parameters.
var ScreenshotOptions = {
"screenRect": {
"left": 200,
"top": 100,
"width": 200,
"height": 200},
"imageSize": {
"width": 300,
"height": 300},
"rotation": 0
};
let image; // image is used to save the screenshot.
screenshot.save(ScreenshotOptions).then((image) => {
console.log('screenshot.save success, screenshot image :' + JSON.stringify(image));
}, (err) => {
console.log('screenshot.save failed, error : ' + JSON.stringify(err));
})
```
# Screenshot Overview
The screenshot APIs, with parameters, enable you to take screenshots on display devices.
## Basic Concepts
Screenshot: provides the screenshot capability.
......@@ -190,17 +190,10 @@
- [后台提醒开发指导](notification/background-agent-scheduled-reminder-guide.md)
- [调试助手使用指导](notification/assistant-guidelines.md)
- 窗口管理
- 窗口
- [窗口开发概述](windowmanager/window-overview.md)
- [管理应用窗口(Stage模型)](windowmanager/application-window-stage.md)
- [管理应用窗口(FA模型)](windowmanager/application-window-fa.md)
- [管理系统窗口(仅Stage模型支持)](windowmanager/system-window-stage.md)
- 屏幕属性
- [屏幕属性开发概述](windowmanager/display-overview.md)
- [屏幕属性开发指导](windowmanager/display-guidelines.md)
- 屏幕截图
- [屏幕截图开发概述](windowmanager/screenshot-overview.md)
- [屏幕截图开发指导](windowmanager/screenshot-guidelines.md)
- [窗口开发概述](windowmanager/window-overview.md)
- [管理应用窗口(Stage模型)](windowmanager/application-window-stage.md)
- [管理应用窗口(FA模型)](windowmanager/application-window-fa.md)
- [管理系统窗口(仅Stage模型支持)](windowmanager/system-window-stage.md)
- WebGL
- [WebGL开发概述](webgl/webgl-overview.md)
- [WebGL开发指导](webgl/webgl-guidelines.md)
......@@ -639,7 +632,6 @@
- JS服务卡片UI组件参考
- JS服务卡片UI框架说明
- [文件组织](reference/js-service-widget-ui/js-service-widget-file.md)
- [配置文件](reference/js-service-widget-ui/js-service-widget-config-file.md)
- 语法
- [HML语法参考](reference/js-service-widget-ui/js-service-widget-syntax-hml.md)
- [CSS语法参考](reference/js-service-widget-ui/js-service-widget-syntax-css.md)
......
# 窗口管理
- 窗口
- [窗口开发概述](window-overview.md)
- [管理应用窗口(Stage模型)](application-window-stage.md)
- [管理应用窗口(FA模型)](application-window-fa.md)
- [管理系统窗口(仅Stage模型支持)](system-window-stage.md)
- 屏幕属性
- [屏幕属性开发概述](display-overview.md)
- [屏幕属性开发指导](display-guidelines.md)
- 屏幕截图
- [屏幕截图开发概述](screenshot-overview.md)
- [屏幕截图开发指导](screenshot-guidelines.md)
\ No newline at end of file
- [窗口开发概述](window-overview.md)
- [管理应用窗口(Stage模型)](application-window-stage.md)
- [管理应用窗口(FA模型)](application-window-fa.md)
- [管理系统窗口(仅Stage模型支持)](system-window-stage.md)
\ No newline at end of file
# 屏幕属性开发指导
## 场景介绍
应用通过调用屏幕接口获取默认Display或者所有Display的属性。
## 接口说明
完整版的接口定义请参考API接口说明文件:[屏幕属性](../reference/apis/js-apis-display.md)
## 开发步骤
通过`getDefaultDisplay(): Promise<Display>`来获取当前默认的`Display`对象,具体代码示例可参考:
```js
import display from '@ohos.display' // 导入模块
display.getDefaultDisplay().then((disp) => {
console.log('display.getDefaultDisplay success, display :' + JSON.stringify(disp));
}, (err) => {
console.log('display.getDefaultDisplay failed, error : ' + JSON.stringify(err));
})
```
## 相关实例
针对屏幕属性开发,有以下相关实例可供参考:
- [`Screen`:屏幕属性(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Screen)
# 屏幕属性开发概述
屏幕具有显示应用窗口布局的能力,屏幕属性包括:屏幕id号、屏幕名称、屏幕启用标识、屏幕状态、屏幕刷新率、屏幕旋转角度、屏幕宽度、屏幕高度、屏幕像素密度、屏幕字体缩放因子和每英寸屏幕的确切物理像素值。
## 基本概念
`Display`:Display指的是对应用可见的屏幕,这是一种抽象的屏幕概念,与真实的物理屏幕不同,可作为窗口容器。
# 屏幕截图开发指导
## 场景介绍
指定显示设备进行特定参数的屏幕截图。
## 接口说明
完整版的接口定义请参考API接口说明文件:[屏幕截图](../reference/apis/js-apis-screenshot.md)
## 开发步骤
通过接口`save(options?: ScreenshotOptions): Promise<image.PixelMap>`进行屏幕截图。其中`options`为预定义的截屏参数,如果没有输入`options`,则使用默认截取整屏,具体代码示例可参考:
```js
import screenshot from '@ohos.screenshot' // 导入模块
// 设置屏幕截图参数
let screenshotOps = {
"screenRect": {
"left": 200,
"top": 100,
"width": 200,
"height": 200},
"imageSize": {
"width": 300,
"height": 300},
"rotation": 0
};
screenshot.save(screenshotOps).then((image) => {
console.log('screenshot.save success, screenshot image :' + JSON.stringify(image));
}, (err) => {
console.log('screenshot.save failed, error : ' + JSON.stringify(err));
})
```
## 相关实例
针对屏幕截图开发,有以下相关实例可供参考:
- [`Screenshot`:屏幕截图(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/Basic/Screenshot)
# 屏幕截图开发概述
提供指定显示设备下特定参数的屏幕截图能力。
## 基本概念
`screenshot`:提供屏幕截图能力。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册