当前位置:网站首页>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
边栏推荐
- Attack and defense world mobile--ph0en1x-100
- Express abstract classes and methods
- Social community forum app ultra-high appearance UI interface
- 4. Wireless in vivo nano network: electromagnetic propagation model and key points of sensor deployment
- [ArcGIS user defined script tool] vector file generates expanded rectangular face elements
- studio All flavors must now belong to a named flavor dimension. Learn more
- 4. 无线体内纳米网:电磁传播模型和传感器部署要点
- Application of ncnn Neural Network Computing Framework in Orange Pi 3 Lts Development Board
- C graphical tutorial (Fourth Edition)_ Chapter 17 generic: genericsamplep315
- 高效能人士的七个习惯
猜你喜欢

【数据库原理及应用教程(第4版|微课版)陈志泊】【第四章习题】

Seven second order ladrc-pll structure design of active disturbance rejection controller

Quick learning 1.8 front and rear interfaces

Application of ncnn Neural Network Computing Framework in Orange Pi 3 Lts Development Board

Differences between initial, inherit, unset, revert and all

4. 无线体内纳米网:电磁传播模型和传感器部署要点

社交社区论坛APP超高颜值UI界面

基于同步坐标变换的谐波电流检测

Application of ncnn neural network computing framework in orange school orangepi 3 lts development board

【ArcGIS自定义脚本工具】矢量文件生成扩大矩形面要素
随机推荐
对业务的一些思考
2022-01-27 redis cluster technology research
The latest version of lottery blind box operation version
CNN MNIST handwriting recognition
Sword finger offer14 the easiest way to cut rope
Four problems and isolation level of MySQL concurrency
C graphical tutorial (Fourth Edition)_ Chapter 17 generic: genericsamplep315
Node.js: express + MySQL的使用
Two solutions of leetcode101 symmetric binary tree (recursion and iteration)
【数据挖掘复习题】
Low code platform international multilingual (I18N) technical solution
Drop down refresh conflicts with recyclerview sliding (swiperefreshlayout conflicts with recyclerview sliding)
C graphical tutorial (Fourth Edition)_ Chapter 13 entrustment: what is entrustment? P238
基于同步坐标变换的谐波电流检测
Express abstract classes and methods
SQL learning notes (I)
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
Kung Fu pays off, and learning is done
并网-低电压穿越与孤岛并存分析
[network counting] Chapter 3 data link layer (2) flow control and reliable transmission, stop waiting protocol, backward n frame protocol (GBN), selective retransmission protocol (SR)