From d7826859630422a3c7440487eb28071675206767 Mon Sep 17 00:00:00 2001 From: zhoulisheng <635547767@qq.com> Date: Fri, 25 Mar 2022 14:08:42 +0800 Subject: [PATCH] 1.delete useless JpegProgressTestCasePage Signed-off-by: zhoulisheng <635547767@qq.com> --- entry/src/main/config.json | 3 +- .../src/main/ets/MainAbility/pages/index.ets | 6 +- .../pages/jpegProgressTestCasePage.ets | 74 ------------------- 3 files changed, 2 insertions(+), 81 deletions(-) delete mode 100644 entry/src/main/ets/MainAbility/pages/jpegProgressTestCasePage.ets diff --git a/entry/src/main/config.json b/entry/src/main/config.json index f9ae741..c186ef2 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -129,8 +129,7 @@ "pages/testMultiThreadWorkerPage2", "pages/testGlideOptionChangedPage", "pages/CropImagePage", - "pages/networkTestCasePage", - "pages/jpegProgressTestCasePage" + "pages/networkTestCasePage" ], "name": ".MainAbility", "window": { diff --git a/entry/src/main/ets/MainAbility/pages/index.ets b/entry/src/main/ets/MainAbility/pages/index.ets index 76cf4d2..02caf33 100644 --- a/entry/src/main/ets/MainAbility/pages/index.ets +++ b/entry/src/main/ets/MainAbility/pages/index.ets @@ -87,11 +87,7 @@ struct Index { console.log("测试二级内存缓存") router.push({ uri: "pages/storageTestDiskLruCache" }); }).margin({ top: 5, left: 3 }) - Button("测试JPEG") - .onClick(() => { - console.log("测试JPEG") - router.push({ uri: "pages/JpegProgressTestCasePage" }); - }).margin({ top: 5, left: 3 }) + }.width('100%') .height(60).backgroundColor(Color.Pink) diff --git a/entry/src/main/ets/MainAbility/pages/jpegProgressTestCasePage.ets b/entry/src/main/ets/MainAbility/pages/jpegProgressTestCasePage.ets deleted file mode 100644 index 8bf1c83..0000000 --- a/entry/src/main/ets/MainAbility/pages/jpegProgressTestCasePage.ets +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {GlideImage} from "../glide/GlideImage" -import {GlideOption} from "../glide/GlideOption" -import {FileUtils} from "../cache/FileUtils" -import {RotateImageTransformation} from "../glide/transform/RotateImageTransformation" -import {RoundedCornersTransformation} from "../glide/transform/RoundedCornersTransformation" -import resourceManager from '@ohos.resourceManager'; -import image from "@ohos.multimedia.image" -@Entry -@Component -struct JpegProgressTestCasePage { - - - build() { - Scroll() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Button('点击调用渐进式解码') - .onClick(()=> { - resourceManager.getResourceManager() - .then(result => { - result.getMedia($r('app.media.jpgSample').id) - .then(data => { - let arrayBuffer = FileUtils.getInstance().uint8ArrayToBuffer(data); - let imageSourceIncrementalSApi = image.createIncrementalSource(data); - let array = [1,2,3,4,5,6,7,8,9,10]; - imageSourceIncrementalSApi.updateData(array, false,(error,data) => { - console.log("data is null="+(data == null || data == undefined)) - console.log("array = "+array) - console.log("data ="+data) - - }) - }) - }) - - }) - Button('点击调用渐进式解码带上length') - .onClick(()=> { - resourceManager.getResourceManager() - .then(result => { - result.getMedia($r('app.media.jpgSample').id) - .then(data => { - let arrayBuffer = FileUtils.getInstance().uint8ArrayToBuffer(data); - let imageSourceIncrementalSApi = image.createIncrementalSource(data); - let array = [1,2,3,4,5,6,7,8,9,10]; - imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data) => { - console.log("data is null="+(data == null || data == undefined)) - console.log("array = "+array) - console.log("data ="+data) - - }) - }) - }) - - }) - } - } - .width('100%') - .height('100%') - } -} -