سلام بر تمامی برنامه نویسان عزیز 😉 در این پست کد ساخت دکمه و استفاده از DrawingImage و GeometryDrawing با wpf و c#.net را آماده کردم. امیدوارم که این کد برای شما مفید باشد.
خروجی این کد:
کد ساخت دکمه و استفاده از DrawingImage و GeometryDrawing با wpf و c#.net :
<Window x:Class="Chapter05.DrawingImageExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="DrawingImage Example" Height="130" Width="320">
<Button Name="DrawRectangle" Grid.Column="1"
ToolTip="Draw Rectangle" Margin="5">
<Image Width="80" Height="80">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="LightGray">
<GeometryDrawing.Geometry>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="DrawingImage Example" Height="130" Width="320">
<Button Name="DrawRectangle" Grid.Column="1"
ToolTip="Draw Rectangle" Margin="5">
<Image Width="80" Height="80">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<GeometryDrawing Brush="LightGray">
<GeometryDrawing.Geometry>