سلام 😉 در این مطلب کد پرکردن Polygon با RadialGradientBrush با wpf و سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
تصاویر خروجی نهایی این کد:
کد پرکردن Polygon با RadialGradientBrush با wpf و سی شارپ #C :
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Microsoft.Samples.Graphics.RectangleExample"
WindowTitle="Example">
<Canvas>
<Polygon Name="hexagon"
Stroke="Blue"
StrokeThickness="2.0"
Points="16,130 302,13 304,249 76,322 493,249 495,103">
<Polygon.Fill>
<RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Microsoft.Samples.Graphics.RectangleExample"
WindowTitle="Example">
<Canvas>
<Polygon Name="hexagon"
Stroke="Blue"
StrokeThickness="2.0"
Points="16,130 302,13 304,249 76,322 493,249 495,103">
<Polygon.Fill>
<RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">