zoukankan      html  css  js  c++  java
  • GdiPlus[20]: IGPPathGradientBrush 之 SetFocusScales


    测试效果图:



    测试代码:

    uses GdiPlus;
    
    procedure TForm1.FormPaint(Sender: TObject);
    var
      Graphics: IGPGraphics;
      Brush: IGPPathGradientBrush;
      Rect: TGPRect;
      Path: IGPGraphicsPath;
    begin
      Graphics := TGPGraphics.Create(Handle);
      Rect.Initialize(10, 10, 180, 100);
      Path := TGPGraphicsPath.Create;
      Path.AddEllipse(Rect);
    
      Brush := TGPPathGradientBrush.Create(Path);
      Brush.CenterColor := $FF00FF00;
      Brush.SetSurroundColors([$FF000000]);
    
      Brush.SetFocusScales(0, 0); //这是默认设置
      Graphics.FillEllipse(Brush, Rect);
    
      Brush.SetFocusScales(0.5, 0);
      Graphics.TranslateTransform(0, Rect.Y + Rect.Height);
      Graphics.FillEllipse(Brush, Rect);
    
      Brush.SetFocusScales(0, 0.5);
      Graphics.TranslateTransform(0, Rect.Y + Rect.Height);
      Graphics.FillEllipse(Brush, Rect);
    end;
    
  • 相关阅读:
    Daily Scrum (2015/10/28)
    Dailu Scrum (2015/10/27)
    wenbao与cmd
    wenbao与IIS
    wenbao与模板
    wenbao与git
    wenbao与vscode
    wenbao与矩阵
    wenbao与面试题
    wenbao 与将linux系统(kali)装入U盘
  • 原文地址:https://www.cnblogs.com/del/p/1624635.html
Copyright © 2011-2022 走看看