当前位置: 首页 > news >正文

C# Avalonia 12- Drawing - Gradients

Gradients.axaml代码

<Window xmlns="https://github.com/avaloniaui"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"Height="587" Width="347"x:Class="AvaloniaUI.Gradients"Title="Gradients"><Grid Margin="5" RowDefinitions="auto,auto,auto,auto,auto" ColumnDefinitions="*,auto"><Rectangle Width="150" Height="100" Margin="5"><Rectangle.Fill><LinearGradientBrush ><GradientStop Color="Blue" Offset="0"/><GradientStop Color="White" Offset="1" /></LinearGradientBrush></Rectangle.Fill></Rectangle><TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="5">Diagonal Linear Gradient</TextBlock><Rectangle Width="150" Height="100" Margin="5" Grid.Row="1"><Rectangle.Fill><LinearGradientBrush><GradientStop Color="Blue" Offset="0"/><GradientStop Color="White" Offset="0.5" /></LinearGradientBrush></Rectangle.Fill></Rectangle><TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="5">With 0.5 Offset for White</TextBlock><Rectangle Width="150" Height="100" Grid.Row="2" Margin="5"><Rectangle.Fill><LinearGradientBrush StartPoint="0,0" EndPoint="0%,100%"><GradientStop Color="Blue" Offset="0"/><GradientStop Color="White" Offset="1" /></LinearGradientBrush></Rectangle.Fill></Rectangle><TextBlock Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="5">Horizontal Linear Gradient</TextBlock><Rectangle Width="150" Height="100" Grid.Row="3" Margin="5"><Rectangle.Fill><LinearGradientBrush StartPoint="0,0" EndPoint="0%,50%" SpreadMethod="Reflect"><GradientStop Color="Blue" Offset="0"/><GradientStop Color="White" Offset="1" /></LinearGradientBrush></Rectangle.Fill></Rectangle><TextBlock Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Margin="5">Reflected Gradient</TextBlock><Rectangle Width="150" Height="100" Grid.Row="4" Margin="5"><Rectangle.Fill><LinearGradientBrush StartPoint="0,0" EndPoint="100%,100%"><GradientStop Color="Yellow" Offset="0.0" /><GradientStop Color="Red" Offset="0.25" /><GradientStop Color="Blue" Offset="0.75" /><GradientStop Color="LimeGreen" Offset="1.0" /></LinearGradientBrush></Rectangle.Fill></Rectangle><TextBlock Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" Margin="5">Multicolored Gradient</TextBlock></Grid>
</Window>

Gradients.axaml.cs代码

using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;namespace AvaloniaUI;public partial class Gradients : Window
{public Gradients(){InitializeComponent();}
}

运行效果

image

 

http://www.sczhlp.com/news/67879/

相关文章:

  • php网站源码带后台如何经营一个网店
  • 劲松网站建设codex wordpress org
  • 手机网站大全下载织梦网站app生成器
  • app制作简易网站html指令代码大全
  • wordpress静态化经验seo查询工具精准
  • 无锡网站公司wordpress分类页打不开
  • 酒仙网的网站推广方式建设银行附近网站点
  • 外贸网站怎么做促销软件开发行业现状
  • 宝塔设置加速wordpress站点网站基本配置
  • 上海网站建设 公司案例网页布局代码及效果图
  • 移花接木——MBR向GPT迁移
  • 不只是语言:ObjectSense的生态愿景与未来
  • 做国外零售做什么网站宾馆管理系统
  • 游戏开服表网站开发网站开发江西
  • 唯美音乐图文网站建设橙色网站欣赏
  • 做算法题的 网站wordpress the7 建站
  • 按键精灵官方网站怎么做脚本wordpress 文档管理
  • wordpress 免费么seo的实现方式
  • 男男做的视频网站wordpress图片ssl
  • 做毕业设计免费网站创意规划设计有限公司官网
  • 做竞品分析去哪个网站手机网站如何优化
  • 在 Windows 上部署支持 CUDA 的 Docker 容器
  • 基于MATLAB的电力磁电机内的电磁场计算程序的GUI实现
  • 心理咨询网站建设建设招标网官方网站电脑版
  • 环保网站模版备案通过网站还是打不开
  • 婚纱照网站模板佛山营销网站建设联系方式
  • 湖南网站制作群晖建站教程
  • 数字基带传输通信仿真系统
  • 审计Ask Astro LLM问答应用:四大安全漏洞与防御实践
  • 噬菌体展示技术双赋能!组织归巢精准靶向与抗血管生成策略革新