登录
首页 » C#源码 » C# 图像控件显示绘制的几何图形

C# 图像控件显示绘制的几何图形

于 2022-03-07 发布 文件大小:12.18 kB
0 191
下载积分: 2 下载次数: 1

代码说明:

C# 使用图像控件显示绘制的多个几何图形,可一次显示多个绘制的图形,相关代码如下:   GeometryGroup MyGeometry = new GeometryGroup();   MyGeometry.Children.Add(new EllipseGeometry(new Point(50, 50), 45, 20));   MyGeometry.Children.Add(new EllipseGeometry(new Point(50, 50), 20, 45));   RectangleGeometry MyRectangle = new RectangleGeometry();   MyRectangle.Rect = new Rect(2, 2, 96, 96);   MyGeometry.Children.Add(MyRectangle);   GeometryDrawing MyDrawing = new GeometryDrawing();   MyDrawing.Geometry = MyGeometry;   MyDrawing.Pen = new Pen(Brushes.Blue, 3);   DrawingImage MyImage = new DrawingImage();   MyImage.Drawing = MyDrawing;   MyImage.Freeze();   this.image1.Source = MyImage;

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C# 制作一个顶层显示的窗口-不被其它窗口遮挡
    C#设置顶层显示的窗口,让窗口显示在其它窗口的最上面,不被遮挡,这种窗口形式或许大家平时都见到过,特别是一些视频播放器,在播放视频的时候,都可以设置是否顶层显示,本示例就是模拟了这个功能,通过“允许以最顶层方式显示窗口”和“禁止以最顶层方式显示窗口”来模拟启用和关闭顶层窗口的功能,代码貌似简单:   private void button1_Click(object sender, RoutedEventArgs e)   {//允许以最顶层方式显示窗口    this.Topmost = true;   }   private void button2_Click(object sender, RoutedEventArgs e)   {//禁止以最顶层方式显示窗口    this.Topmost = false;   }
    2023-05-27 13:10:03下载
    积分:1
  • 鬼影源码去验证码3389 版本 用户
    鬼影源码去验证码3389 版本 用户 鬼影源码去验证码非常好用的
    2023-02-13 00:05:04下载
    积分:1
  • C# 打印XPS文档 XPS文件打印
    C# 打印选择的XPS文档,打印XPS文件,相关代码如下:   private void button1_Click(object sender, RoutedEventArgs e)   {//打印选择的XPS文档    var MyDlg = new Microsoft.Win32.OpenFileDialog();    MyDlg.InitialDirectory = System.IO.Directory.GetCurrentDirectory();    MyDlg.Filter = "XPS文件(*.xps)|*.xps|所有文件(*.*)|*.*";    if (MyDlg.ShowDialog() == true)    {    string MyFileName = MyDlg.FileName;    var pDialog = new PrintDialog();    pDialog.PageRangeSelection = PageRangeSelection.AllPages;    pDialog.UserPageRangeEnabled = true;    if (pDialog.ShowDialog() == true)    {    var MyDocument = new System.Windows.Xps.Packaging.XpsDocument(MyFileName, System.IO.FileAccess.ReadWrite);    FixedDocumentSequence MyFixedDocumentSequence = MyDocument.GetFixedDocumentSequence();    pDialog.PrintDocument(MyFixedDocumentSequence.DocumentPaginator, "我的XPS打印文档");    }    }   }
    2022-03-23 09:37:24下载
    积分:1
  • Visual C# 查询指定时间间隔的数据
    Visual C# 查询指定时间间隔的数据,根据学生出生年月查询学生年龄,代码如下:   private DataTable GetMessage()   {    string P_Str_ConnectionStr = string.Format(//创建数据库连接字符串    @"server=WIN-GI7E47AND9RLS;database=db_TomeTwo;uid=sa;pwd=");    string P_Str_SqlStr = string.Format(//创建SQL查询字符串    "select 学生姓名,出生年月 from tb_Student");    SqlDataAdapter P_SqlDataAdapter = new SqlDataAdapter(//创建数据适配器    P_Str_SqlStr, P_Str_ConnectionStr);    DataTable P_dt = new DataTable();//创建数据表    P_SqlDataAdapter.Fill(P_dt);//填充数据表    return P_dt;//返回数据表   }
    2022-03-02 08:45:17下载
    积分:1
  • C#将checkbox应用于combobox中 源码实例
    C#将checkbox应用于combobox中 源码实例,在下拉列表combobox中增加复选框按钮的用法实例,这些用法包括排列布局、数量分配等,在演示窗口的按钮中,单击按钮可看到不同的运用效果,这在平时的使用中,会大大扩展combox的功能。
    2022-08-20 12:13:56下载
    积分:1
  • C# 最经典 简单的progressBar进度条用法示例
    这是一个大家都熟悉的实用技巧,用C#制作进度条功能,本代码演示了最简单,且实现方法简单的progressBar进度条用法示例,   单击按钮后,开始演示进度条效果,这部分代码写在按钮事件中:   progressBar1.Value = 0;//设置进度条的初始值   progressBar1.Minimum = 0;//设置progressBar1控件的Minimum值为0   progressBar1.Maximum = 500;//设置progressBar1的Maximum值为500   progressBar1.Step = 1;//设置progressBar1的增值为1   for (int i = 0; i < 500; i++)//调用for语句循环递增   {    progressBar1.PerformStep();//使用PerformStep方法按Step值递增    textBox1.Text = "进度值:" + progressBar1.Value.ToString();   }
    2022-08-18 01:25:55下载
    积分:1
  • C#制作文字渐变的 WPF 窗体按钮特效
    C#制作文字渐变的 WPF 窗体按钮特效,就是大家熟悉的渐变按钮,按钮的大小会随窗口的变化而变化,且按钮中的文本颜色呈现渐变色彩,当鼠标悬停于上面时,还会具有不同的渐变动画效果,截图所示为静态效果,请下载后编译查看动画效果.
    2022-01-26 00:26:26下载
    积分:1
  • C# 模拟Windows CMD Ping命令
    C# 模拟Windows CMD Ping命令,这个Ping和Windows中的控制台Ping命令几乎一样,如果用户没有输入任何参数则给出提示,初始化一个ICMP类型的Socket,用户提供了主机名和循环参数(开关,“/r”),调用 PingHost 方法并将主机名作为参数传递给它,如果用户还提供了其他的参数则忽略,取得报文内容,转化为字节数组,然后计算报文的长度。   在校验和算法方面,把ICMP报头二进制数据以2字节为单位累加起来,若ICMP报头为奇数个字节,会剩下最后一字节。把最后一个字节视为一个2字节数据的高字节,这个2字节数据的低字节为0,继续累加。。
    2023-05-08 16:20:03下载
    积分:1
  • C# 为文字创建渐变色的下划线
    C# 为文字创建渐变色的下划线,放大后还是很漂亮的,下划线变成了点状的,而且是颜色是渐变的,下面介绍实现这一功能的代码,给字符串创建渐变色下划线,核心代码如下:   TextDecoration MyUnderline = new TextDecoration();   Pen MyPen = new Pen();   MyPen.Brush = new LinearGradientBrush(Colors.Green,    Colors.Blue, new Point(0, 0.5), new Point(1, 0.5));   MyPen.Brush.Opacity = 0.5;   MyPen.Thickness = 1.5;   MyPen.DashStyle = DashStyles.Dash;   MyUnderline.Pen = MyPen;   MyUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended;   TextDecorationCollection MyCollection = new TextDecorationCollection();   MyCollection.Add(MyUnderline);   this.textBlock1.Text = "中华人民共和国";//自定义要显示下划线的文字   this.textBlock1.FontSize = 48;   this.textBlock1.TextDecorations = MyCollection;   需要请下载完整源码。运行效果图如下。
    2022-01-22 05:14:06下载
    积分:1
  • 7Zip
    This file is part of SevenZipSharp.    SevenZipSharp is free software: you can redistribute it and/or modify    it under the terms of the GNU Lesser General Public License as published by    the Free Software Foundation, either version 3 of the License, or    (at your option) any later version.    SevenZipSharp is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public License    along with SevenZipSharp.  If not, see .
    2022-07-20 00:09:31下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载