鸿蒙平台实现高斯模糊的渐变色

原图:

加上之后的效果:

代码:

scss 复制代码
@Builder
C2() {
  Stack({ alignContent: Alignment.Bottom }) {
    Image($r('app.media.landscape'))
      .width('100%')
      .height('100%')
      .objectFit(ImageFit.Cover)
      .borderWidth(2)
      .borderColor('#ff0000')
    Column() {
    }
    .width('100%')
    .height('100%')
    .borderWidth(2)
    .borderColor('#0000ff')
    .linearGradient({
      direction: GradientDirection.Bottom,
      colors: [
        ['#FFFFFFFF', 0.0],
        ['#FFFFFFFF', 0.6],
        ['#00FFFFFF', 1.0]
      ]
    })
    .blendMode(BlendMode.DST_IN)
  }
  .width('100%')
  .height('25%')
  .blendMode(BlendMode.SRC_OVER, BlendApplyType.OFFSCREEN)
}

End

相关推荐
lilian23313 分钟前
Harmony os 技术实战|拼豆制图09:把 50 张图库素材做成可复跑的生产管线
华为·harmonyos
chjif2 小时前
Android 设备管控开发实战:企业受控终端的 DNS 域名策略实现
android·华为·harmonyos
OH_TPC3 小时前
【鸿蒙优选三方库】@ohos/grpc:在 HarmonyOS 上像调本地方法一样调远程服务
华为·harmonyos·鸿蒙
达子6663 小时前
第30章_综合案例:HarmonyOs开发图解之 俄罗斯方块游戏
游戏·华为·harmonyos
云端漫步19873 小时前
HarmonyOS NEXT AI 应用开发总结:30 篇之旅
人工智能·华为·harmonyos
math_hongfan4 小时前
鸿蒙Agent高级技能自定义开发:自定义意图服务/能力注册/Agent技能编排/服务插件开发实战
android·学习·华为·harmonyos·鸿蒙
云端漫步19876 小时前
HarmonyOS NEXT AI 智能生活助手:项目打包与发布
人工智能·华为·生活·harmonyos
less_121387 小时前
HarmonyOS WPS Open SDK:关闭回传 URI-FD 与沙箱 filePath
华为·harmonyos·wps
math_hongfan7 小时前
鸿蒙多模态AI交互高级:图文+语音+手势融合交互/多模态大模型端侧适配/跨模态检索高阶实战
人工智能·学习·华为·交互·语音识别·harmonyos·鸿蒙
云端漫步19877 小时前
HarmonyOS NEXT AI 智能生活助手:源码解析与项目复盘
人工智能·华为·生活·harmonyos