add resources to support image tile mode.

This commit is contained in:
吴尚昆
2022-03-17 17:27:02 +08:00
committed by osborn
parent 77617df848
commit 3f017a9beb
6 changed files with 63 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

View File

@@ -158,7 +158,7 @@ class ImageDemo extends Panel {
scaleType: ScaleType.ScaleAspectFill,
layoutConfig: layoutConfig().just(),
}),
label('StretchInset'),
label('StretchInset1'),
image({
imageBase64: img_base64[1],
height: 60,
@@ -179,25 +179,51 @@ class ImageDemo extends Panel {
bottom: 0
}
}),
label('tileInset'),
label('StretchInset 2'),
image({
imageBase64: img_base64[1],
height: 66,
width: 147,
image: new AssetsResource("coupon_bg2.png"),
height: 48,
width: 78,
scaleType: ScaleType.ScaleAspectFill,
layoutConfig: layoutConfig().just(),
}),
image({
imageBase64: img_base64[1],
height: 66 * 2,
width: 147 * 2,
backgroundColor: Color.CYAN,
image: new AssetsResource("coupon_bg2.png"),
height: 48,
width: 78*3,
scaleType: ScaleType.ScaleToFill,
imageScale:1,
layoutConfig: layoutConfig().just(),
stretchInset: {
left: 0,
top: 0,
right: 76,
bottom: 0
}
}),
label('tileInset'),
image({
image: new AssetsResource("dididi.png"),
height: 78,
width: 84,
backgroundColor: Color.BLACK,
scaleType: ScaleType.ScaleAspectFill,
layoutConfig: layoutConfig().just(),
}),
image({
image: new AssetsResource("dididi.png"),
height: 78 * 1,
width: 84 * 3,
imageScale:1,
backgroundColor: Color.BLACK,
scaleType: ScaleType.ScaleToFill,
layoutConfig: layoutConfig().just(),
tileInset: {
left: 0,
top: 0,
right: 83,
right: 0,
bottom: 0
}
}),
@@ -242,4 +268,4 @@ class ImageDemo extends Panel {
onDestroy() {
modal(context).toast('onDestroy')
}
}
}