當前位置: 首頁>>代碼示例>>C#>>正文


C# Color.MakeShaded方法代碼示例

本文整理匯總了C#中Color.MakeShaded方法的典型用法代碼示例。如果您正苦於以下問題:C# Color.MakeShaded方法的具體用法?C# Color.MakeShaded怎麽用?C# Color.MakeShaded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Color的用法示例。


在下文中一共展示了Color.MakeShaded方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RenderDepressedCircularButton

 private static void RenderDepressedCircularButton(this Graphics Graphics, Rectangle ClientRectangle, Color BackGroundColor, Single Depth = 1)
 {
     using (var pen = new Pen(BackGroundColor, Depth))
     using (var brush = new System.Drawing.Drawing2D.LinearGradientBrush(ClientRectangle, BackGroundColor.MakeShaded(50), BackGroundColor.MakeHilighted(10), LinearGradientMode.ForwardDiagonal)) {
         Graphics.FillEllipse(brush, ClientRectangle);
         var originalSmoothingMode = Graphics.SmoothingMode;
         try {
             Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
             Graphics.DrawEllipse(pen, ClientRectangle);
         } finally {
             Graphics.SmoothingMode = originalSmoothingMode;
         }
     }
     Graphics.RenderCircle(ClientRectangle, BackGroundColor.MakeShaded(15), Depth);
 }
開發者ID:StewartScottRogers,項目名稱:RealtimeControlsSolution,代碼行數:15,代碼來源:CircularButtonRenderer.cs

示例2: RenderRaisedDisk

 public static void RenderRaisedDisk(this Graphics Graphics, Rectangle ClientRectangle, Color BackGroundColor, Single Depth = 1)
 {
     using (var darkPen = new Pen(BackGroundColor.MakeShaded(50), Depth))
     using (var lightPen = new Pen(BackGroundColor.MakeHilighted(50), Depth)) {
         Graphics.DrawArc(darkPen, ClientRectangle, -45, 180);
         Graphics.DrawArc(lightPen, ClientRectangle, 135, 180);
     }
 }
開發者ID:StewartScottRogers,項目名稱:RealtimeControlsSolution,代碼行數:8,代碼來源:DiskRenderer.cs

示例3: RenderNonFocusedRadialBezel

 public static Rectangle RenderNonFocusedRadialBezel(this Graphics Graphics, Rectangle ClientRectangle, Color BackGroundColor)
 {
     using (var pen = new Pen(BackGroundColor.MakeShaded(40), 1)) {
         pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
         pen.DashCap = System.Drawing.Drawing2D.DashCap.Round;
         Graphics.DrawEllipse(pen, ClientRectangle);
         var reducedRectangle = new Rectangle(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
         reducedRectangle.Inflate(-1, -1);
         return reducedRectangle;
     }
 }
開發者ID:StewartScottRogers,項目名稱:RealtimeControlsSolution,代碼行數:11,代碼來源:RadialBazelRenderer.cs


注:本文中的Color.MakeShaded方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。