首页 > 其他分享 >LinearGradientBrush

LinearGradientBrush

时间:2023-12-04 17:01:18浏览次数:21  
标签:EndPoint 人上 效果 从左到右 LinearGradientBrush StartPoint

渐变方向

 默认是左上角到右下角

从左到右

<Border Height="35" Width="120">
    <Border.Background>
        <LinearGradientBrush EndPoint="1,0">
            <GradientStop Color="Yellow"
              Offset="0.1" />
            <GradientStop Color="Green"
              Offset="1.0" />
        </LinearGradientBrush>
    </Border.Background>
</Border>

效果:

  

人上到下

<Border Height="35" Width="120">
    <Border.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="Yellow"
              Offset="0.1" />
            <GradientStop Color="Green"
              Offset="1.0" />
        </LinearGradientBrush>
    </Border.Background>
</Border>

效果:

 

标签:EndPoint,人上,效果,从左到右,LinearGradientBrush,StartPoint
From: https://www.cnblogs.com/stevenchen2016/p/17875354.html

相关文章

  • GDI+画刷(LinearGradientBrush(三))
    3、LinearGradientBrush(Rect&,Color&,Color&,LinearGradientMode)对四种路径渐变方式进行代码效果展示,如下:变量定义:CDCMemDCIndicator;CBitmapMemBitmapIndicator;CDC*pDC;CComboBoxm_pGradientMode;关键代码:1voidLinearGradientTwoDlg::DoDataE......
  • GDI+画刷(LinearGradientBrush(二))
    2、LinearGradientBrush(Rect&,Color&,Color&,REAL,BOOL),代码演示结果如下所示:注:Rect规定画刷一次所绘制的范围,REAL值是指定颜色渐变的方向变量定义:1CDCMemDCIndicator;2CBitmapMemBitmapIndicator;3CDC*pDC;45REALm_pRealValue;6CSliderCtrlm_pSlid......