diff --git a/entry/src/main/ets/pages/imageknifeTestCaseIndex.ets b/entry/src/main/ets/pages/imageknifeTestCaseIndex.ets index ac35f87..1c5bc58 100644 --- a/entry/src/main/ets/pages/imageknifeTestCaseIndex.ets +++ b/entry/src/main/ets/pages/imageknifeTestCaseIndex.ets @@ -285,6 +285,10 @@ struct IndexFunctionDemo { .onClick(() => { router.pushUrl({ url: "pages/testManyGifLoadWithPage" }); }).margin({ top: 5, left: 3 }) + Button("测试加载长图") + .onClick(() => { + router.pushUrl({ url: "pages/longImageKnifeTestPage" }); + }).margin({ top: 5, left: 3 }) }.width('100%').height(60).backgroundColor(Color.Pink) } } diff --git a/entry/src/main/ets/pages/longImageKnifeTestPage.ets b/entry/src/main/ets/pages/longImageKnifeTestPage.ets new file mode 100644 index 0000000..94ab166 --- /dev/null +++ b/entry/src/main/ets/pages/longImageKnifeTestPage.ets @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 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 { ImageKnifeComponent } from '@ohos/imageknife' + +@Entry +@Component +struct LongImageKnifeTestPage { + build(){ + Scroll(){ + ImageKnifeComponent({imageKnifeOption:{ + loadSrc:$r('app.media.long_pic') + }}).size({ + width:356, + height:3124.90666666668 + }).backgroundColor(Color.Pink) + }.width('100%').height('100%') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.Auto) + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/long_pic.jpg b/entry/src/main/resources/base/media/long_pic.jpg new file mode 100644 index 0000000..b2d7597 Binary files /dev/null and b/entry/src/main/resources/base/media/long_pic.jpg differ diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json index be0efeb..e223df3 100644 --- a/entry/src/main/resources/base/profile/main_pages.json +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -33,6 +33,7 @@ "pages/SignatureTestPage", "pages/hspCacheTestPage", "pages/testManyNetImageLoadWithPage", - "pages/testManyGifLoadWithPage" + "pages/testManyGifLoadWithPage", + "pages/longImageKnifeTestPage" ] } \ No newline at end of file