当前位置:网站首页>Image component in ETS development mode of openharmony application development
Image component in ETS development mode of openharmony application development
2022-07-03 12:57:00 【InfoQ】
Image
(src: string | PixelMap | Resource): ImageAttribute;
quote App Local pictures
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text("media Media resources under the directory ").fontSize(32).fontColor(Color.Orange)
Image($r("app.media.HarmonyOS")) // media Media resources under the directory
.width("100%")
.aspectRatio(1.5)
Text("/common/images Pictures under the directory ").fontSize(32).fontColor(Color.Orange).textAlign(TextAlign.Center)
Image("/common/images/HarmonyOS.jpg") // /common/images Pictures under the directory
.width("100%")
.aspectRatio(1.5)
}
.width('100%')
}
.height('100%')
}
}

Remember to add permissions when quoting network pictures
"abilities": [
{
...
"permissions": ["ohos.permission.INTERNET"],
...
}
]
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text("media Media resources under the directory ").fontSize(32).fontColor(Color.Orange)
Image($r("app.media.HarmonyOS")) // media Media resources under the directory
.width("100%")
.aspectRatio(2.6)
Text("/common/images Pictures under the directory ").fontSize(32).fontColor(Color.Orange).textAlign(TextAlign.Center)
Image("/common/images/HarmonyOS.jpg") // /common/images Pictures under the directory
.width("100%")
.aspectRatio(2.6)
Text(" Network picture ,jpg Format ").fontSize(32).fontColor(Color.Orange).textAlign(TextAlign.Center)
Image("https://img95.699pic.com/photo/50080/9588.jpg_wh300.jpg") // /common/images Pictures under the directory
.width("100%")
.aspectRatio(2.6)
}
.width('100%')
}
.height('100%')
}
}

summary
边栏推荐
- 【习题五】【数据库原理】
- 低代码平台国际化多语言(i18n)技术方案
- 【習題七】【數據庫原理】
- 剑指 Offer 14- II. 剪绳子 II
- 4. Wireless in vivo nano network: electromagnetic propagation model and key points of sensor deployment
- Bert running error: attributeerror: module'tensorflow contrib. tpu' has no attribute 'InputPipelineConfig'
- sitesCMS v3.1.0发布,上线微信小程序
- Low code platform international multilingual (I18N) technical solution
- Sword finger offer14 the easiest way to cut rope
- Exploration of sqoop1.4.4 native incremental import feature
猜你喜欢

Xctf mobile--app1 problem solving

社交社区论坛APP超高颜值UI界面
![[comprehensive question] [Database Principle]](/img/d7/8c51306bb390e0383a017d9097e1e5.png)
[comprehensive question] [Database Principle]

强大的头像制作神器微信小程序

OpenHarmony应用开发之ETS开发方式中的Image组件

Day 1 of kotlin learning: simple built-in types of kotlin

The latest version of lottery blind box operation version

最新版盲盒商城thinkphp+uniapp

电压环对 PFC 系统性能影响分析

【数据库原理复习题】
随机推荐
The latest version of blind box mall thinkphp+uniapp
Kung Fu pays off, and learning is done
Huffman coding experiment report
The foreground uses RSA asymmetric security to encrypt user information
【习题七】【数据库原理】
(最新版) Wifi分销多开版+安装框架
Glide 4.6.1 API initial
Four problems and isolation level of MySQL concurrency
T430 toss and install OS majave 10.14
Openstack node address change
Xctf mobile--app2 problem solving
Using swift language features, write a pseudo-random number generator casually
Swift5.7 extend some to generic parameters
Gan totem column bridgeless boost PFC (single phase) seven PFC duty cycle feedforward
[comprehensive question] [Database Principle]
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
Nodejs+Express+MySQL实现登陆功能(含验证码)
GCN thinking - word2vec directly calculates text classification
sitesCMS v3.0.2发布,升级JFinal等依赖
Attack and defense world mobile--ph0en1x-100