forked from floraachy/ImageKnife
66 lines
2.3 KiB
Plaintext
66 lines
2.3 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 {GlideImage} from "../glide/GlideImage"
|
|
import {GlideOption} from "../glide/GlideOption"
|
|
import {RotateImageTransformation} from "../glide/transform/RotateImageTransformation"
|
|
import {RoundedCornersTransformation} from "../glide/transform/RoundedCornersTransformation"
|
|
|
|
@Entry
|
|
@Component
|
|
struct LoadResourceTestCasePage {
|
|
@State glideOption1: GlideOption =
|
|
{
|
|
loadSrc: $r('app.media.gifSample'),
|
|
size: { width: 300, height: 300 },
|
|
placeholderSrc: $r('app.media.icon_loading'),
|
|
errorholderSrc: $r('app.media.icon_failed'),
|
|
};
|
|
@State glideOption2: GlideOption =
|
|
{
|
|
loadSrc: $r('app.media.bmpSample'),
|
|
size: { width: 300, height: 300 },
|
|
// placeholderSrc: $r('app.media.icon_loading'),
|
|
// errorholderSrc: $r('app.media.icon_failed'),
|
|
};
|
|
@State glideOption3: GlideOption =
|
|
{
|
|
loadSrc: $r('app.media.pngSample'),
|
|
size: { width: 300, height: 300 },
|
|
// placeholderSrc: $r('app.media.icon_loading'),
|
|
// errorholderSrc: $r('app.media.icon_failed'),
|
|
};
|
|
@State glideOption4: GlideOption =
|
|
{
|
|
loadSrc: $r('app.media.jpgSample'),
|
|
size: { width: 300, height: 300 },
|
|
// placeholderSrc: $r('app.media.icon_loading'),
|
|
// errorholderSrc: $r('app.media.icon_failed'),
|
|
};
|
|
|
|
build() {
|
|
Scroll() {
|
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
|
GlideImage({ glideOption: $glideOption1 })
|
|
// GlideImage({ glideOption: $glideOption2 })
|
|
// GlideImage({ glideOption: $glideOption3 })
|
|
// GlideImage({ glideOption: $glideOption4 })
|
|
}
|
|
}
|
|
.width('100%')
|
|
.height('100%')
|
|
}
|
|
}
|
|
|