79 lines
2.9 KiB
Plaintext
79 lines
2.9 KiB
Plaintext
/*
|
|
* 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 {ImageKnifeComponent} from '@ohos/libraryimageknife'
|
|
import {ImageKnifeOption} from '@ohos/libraryimageknife'
|
|
import {RotateImageTransformation} from '@ohos/libraryimageknife'
|
|
import {RoundedCornersTransformation} from '@ohos/libraryimageknife'
|
|
|
|
@Entry
|
|
@Component
|
|
struct FrescoImageTestCasePage {
|
|
@State imageKnifeOption1: ImageKnifeOption =
|
|
{
|
|
loadSrc: "https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83ericA1Mv66TwicuYOtbDMBcUhv1aa9RJBeAn9uURfcZD0AUGrJebAn1g2AjN0vb2E1XTET7fTuLBNmA/132",
|
|
|
|
placeholderSrc: $r('app.media.icon_loading'),
|
|
errorholderSrc: $r('app.media.icon_failed'),
|
|
retryholderSrc: $r('app.media.icon_retry'),
|
|
displayProgress: true,
|
|
canRetryClick:true
|
|
};
|
|
@State ImageKnifeOption: ImageKnifeOption =
|
|
{
|
|
loadSrc: "https://hbimg.huabanimg.com/0ef60041445edcfd6b38d20e19024b2cd9281dcc3525a4-Vy8fYO_fw658/format/webp",
|
|
|
|
placeholderSrc: $r('app.media.icon_loading'),
|
|
errorholderSrc: $r('app.media.icon_failed'),
|
|
retryholderSrc: $r('app.media.icon_retry'),
|
|
displayProgress: true,
|
|
canRetryClick:true
|
|
};
|
|
@State imageKnifeOption3: ImageKnifeOption =
|
|
{
|
|
loadSrc: "https://hbimg.huabanimg.com/95a6d37a39aa0b70d48fa18dc7df8309e2e0e8e85571e-x4hhks_fw658/format/webp",
|
|
|
|
placeholderSrc: $r('app.media.icon_loading'),
|
|
errorholderSrc: $r('app.media.icon_failed'),
|
|
retryholderSrc: $r('app.media.icon_retry'),
|
|
displayProgress: true,
|
|
canRetryClick:true
|
|
};
|
|
@State imageKnifeOption4: ImageKnifeOption =
|
|
{
|
|
loadSrc: "https://hbimg.huabanimg.com/testRetryxxxx",
|
|
|
|
placeholderSrc: $r('app.media.icon_loading'),
|
|
errorholderSrc: $r('app.media.icon_failed'),
|
|
retryholderSrc: $r('app.media.icon_retry'),
|
|
displayProgress: true,
|
|
canRetryClick:true
|
|
};
|
|
|
|
build() {
|
|
Scroll() {
|
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
|
// ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption1 })
|
|
// ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption })
|
|
// ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption3 })
|
|
ImageKnifeComponent({ imageKnifeOption: this.imageKnifeOption4 })
|
|
.width(300)
|
|
.height(300)
|
|
}
|
|
}
|
|
.width('100%')
|
|
.height('100%')
|
|
}
|
|
}
|