!5435 指定density查看图片

Merge pull request !5435 from zt147369/master
This commit is contained in:
openharmony_ci 2023-05-15 04:29:36 +00:00 committed by Gitee
commit ea097eae85
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -656,6 +656,23 @@ declare namespace resourceManager {
*/
getMediaContent(resource: Resource, callback: _AsyncCallback<Uint8Array>): void;
/**
* Obtains the content of the specified screen density media file corresponding to a specified resource object in callback mode.
*
* @param { Resource } resource - Indicates the resource object.
* @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained
* specified screen density media file content.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the module resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by module resId.
* @syscap SystemCapability.Global.ResourceManager
* @stagemodelonly
* @since 10
*/
getMediaContent(resource: Resource, density: number, callback: _AsyncCallback<Uint8Array>): void;
/**
* Obtains the content of the media file corresponding to a specified resource object in Promise mode.
*
@ -681,6 +698,23 @@ declare namespace resourceManager {
*/
getMediaContent(resource: Resource): Promise<Uint8Array>;
/**
* Obtains the content of the specified screen density media file corresponding to a specified resource object in Promise mode.
*
* @param { Resource } resource - Indicates the resource object.
* @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the
* specified resource object.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the module resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by module resId.
* @syscap SystemCapability.Global.ResourceManager
* @stagemodelonly
* @since 10
*/
getMediaContent(resource: Resource, density: number): Promise<Uint8Array>;
/**
* Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode.
*
@ -733,6 +767,23 @@ declare namespace resourceManager {
*/
getMediaContentBase64(resource: Resource, callback: _AsyncCallback<string>): void;
/**
* Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource object in callback mode.
*
* @param { Resource } resource - Indicates the resource object.
* @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the
* specified screen density image resource.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the module resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by module resId.
* @syscap SystemCapability.Global.ResourceManager
* @stagemodelonly
* @since 10
*/
getMediaContentBase64(resource: Resource, density: number, callback: _AsyncCallback<string>): void;
/**
* Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode.
*
@ -758,6 +809,22 @@ declare namespace resourceManager {
*/
getMediaContentBase64(resource: Resource): Promise<string>;
/**
* Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource object in Promise mode.
*
* @param { Resource } resource - Indicates the resource object.
* @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @returns { Promise<string> } The Base64 code of the specified screen density image resource corresponding to the specified resource object.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the module resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by module resId.
* @syscap SystemCapability.Global.ResourceManager
* @stagemodelonly
* @since 10
*/
getMediaContentBase64(resource: Resource, density: number): Promise<string>;
/**
* Obtains the device capability in callback mode.
*
@ -1129,6 +1196,22 @@ declare namespace resourceManager {
*/
getMediaByName(resName: string, callback: _AsyncCallback<Uint8Array>): void;
/**
* Obtains the content of the specified screen density media file corresponding to a specified resource name in callback mode.
*
* @param { string } resName - Indicates the resource name.
* @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained
* specified screen density media file content.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001003 - If the resName invalid.
* @throws { BusinessError } 9001004 - If the resource not found by resName.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaByName(resName: string, density: number, callback: _AsyncCallback<Uint8Array>): void;
/**
* Obtains the content of the media file corresponding to a specified resource name in Promise mode.
*
@ -1154,6 +1237,22 @@ declare namespace resourceManager {
*/
getMediaByName(resName: string): Promise<Uint8Array>;
/**
* Obtains the content of the specified screen density media file corresponding to a specified resource name in Promise mode.
*
* @param { string } resName - Indicates the resource name.
* @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the
* specified resource name.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001003 - If the resName invalid.
* @throws { BusinessError } 9001004 - If the resource not found by resName.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaByName(resName: string, density: number): Promise<Uint8Array>;
/**
* Obtains the Base64 code of the image resource corresponding to the specified resource name in callback mode.
*
@ -1181,6 +1280,22 @@ declare namespace resourceManager {
*/
getMediaBase64ByName(resName: string, callback: _AsyncCallback<string>): void;
/**
* Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource name in callback mode.
*
* @param { string } resName - Indicates the resource name.
* @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the
* specified screen density image resource.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001003 - If the resName invalid.
* @throws { BusinessError } 9001004 - If the resource not found by resName.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaBase64ByName(resName: string, density: number, callback: _AsyncCallback<string>): void;
/**
* Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode.
*
@ -1206,6 +1321,21 @@ declare namespace resourceManager {
*/
getMediaBase64ByName(resName: string): Promise<string>;
/**
* Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource name in Promise mode.
*
* @param { string } resName - Indicates the resource name.
* @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @returns { Promise<string> } The Base64 code of the specified screen density image resource corresponding to the specified resource name.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001003 - If the resName invalid.
* @throws { BusinessError } 9001004 - If the resource not found by resName.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaBase64ByName(resName: string, density: number): Promise<string>;
/**
* Obtains the singular-plural character string represented by the name string corresponding to the
* specified number in callback mode.
@ -1780,6 +1910,22 @@ declare namespace resourceManager {
*/
getMediaContent(resId: number, callback: _AsyncCallback<Uint8Array>): void;
/**
* Obtains the content of the specified screen density media file corresponding to a specified resource ID in callback mode.
*
* @param { number } resId - Indicates the resource ID.
* @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @param { _AsyncCallback<Uint8Array> } callback - Indicates the asynchronous callback used to return the obtained
* specified screen density media file content.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by resId.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaContent(resId: number, density: number, callback: _AsyncCallback<Uint8Array>): void;
/**
* Obtains the content of the media file corresponding to a specified resource ID in Promise mode.
*
@ -1805,6 +1951,21 @@ declare namespace resourceManager {
*/
getMediaContent(resId: number): Promise<Uint8Array>;
/**
* Obtains the content of the specified screen density media file corresponding to a specified resource ID in Promise mode.
*
* @param { number } resId - Indicates the resource ID.
* @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @returns { Promise<Uint8Array> } The content of the specified screen density media file corresponding to the specified resource ID.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by resId.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaContent(resId: number, density: number): Promise<Uint8Array>;
/**
* Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode.
*
@ -1832,6 +1993,22 @@ declare namespace resourceManager {
*/
getMediaContentBase64(resId: number, callback: _AsyncCallback<string>): void;
/**
* Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource ID in callback mode.
*
* @param { number } resId - Indicates the resource ID.
* @param { number } density - The parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @param { _AsyncCallback<string> } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the
* specified screen density image resource.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by resId.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaContentBase64(resId: number, density: number, callback: _AsyncCallback<string>): void;
/**
* Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode.
*
@ -1857,6 +2034,21 @@ declare namespace resourceManager {
*/
getMediaContentBase64(resId: number): Promise<string>;
/**
* Obtains the Base64 code of the specified screen density image resource corresponding to the specified resource ID in Promise mode.
*
* @param { number } resId - Indicates the resource ID.
* @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means
* to use the density of current system dpi.
* @returns { Promise<string> } the Base64 code of the specified screen density image resource corresponding to the specified resource ID.
* @throws { BusinessError } 401 - If the input parameter invalid.
* @throws { BusinessError } 9001001 - If the resId invalid.
* @throws { BusinessError } 9001002 - If the resource not found by resId.
* @syscap SystemCapability.Global.ResourceManager
* @since 10
*/
getMediaContentBase64(resId: number, density: number): Promise<string>;
/**
* Obtains the raw file resource corresponding to the specified resource path in callback mode.
*