-
C# WPF 制作3D动画旋转的地球 超赞 附源码
C# WPF 制作3D动画旋转的地球 超赞 附源码,在源代码中使用了3DTools.dll,不过这仍然是一个非常棒的三维动画实例,使用WPF技术,将一幅静态的BMP地球图像,制作成动态的圆形的地球旋转动画,超逼真的地球动画,请参见测试截图。本源码可为广大C#爱好者学习WPF技术提供一个得力的参考。
- 2022-03-22 09:21:02下载
- 积分:1
-
C#打造自己的智能屏幕取色工具
C#打造自己的智能屏幕取色工具,自动鼠标坐标点的颜色值,取色窗口会自动躲闪鼠标的位置,取色模块从一个继承自Image类的对象中创建Graphics对象,颜色值可以转换为十进制和十六进制,部分初始化源码如下:
[DllImport("gdi32")]
private static extern IntPtr CreateDC(
string lpszDriver, // 驱动名称
string lpszDevice, // 设备名称
string lpszOutput, // 无用,可以设定位"NULL"
IntPtr lpInitData // 任意的打印机数据
);
[DllImport("gdi32.dll")]
private static extern bool BitBlt(
IntPtr hdcDest, // 目标设备的句柄
int nXDest, // 目标对象的左上角的X坐标
int nYDest, // 目标对象的左上角的X坐标
int nWidth, // 目标对象的矩形的宽度
int nHeight, // 目标对象的矩形的长度
IntPtr hdcSrc, // 源设备的句柄
int nXSrc, // 源对象的左上角的X坐标
int nYSrc, // 源对象的左上角的X坐标
int dwRop // 光栅的操作值
- 2022-02-26 10:33:42下载
- 积分:1
-
Visual C#播放媒体文件
Visual C#播放媒体文件,支持播放的文件格式:mpg;*.avi;*.wma;*.wmv;*.mov;*.wav;*.mp2; *.mp3,支持的播放控制功能有:播放、暂停、停止、静音等。
运行后的程序界面如图所示。
- 2023-07-22 03:40:03下载
- 积分:1
-
程序守护(进程守护)-源代码C#
程序守护(进程守护)-源代码C#
/*
* 由SharpDevelop创建。
* 用户: zhang
* 日期: 2017/3/18
* 时间: 21:50
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using System.Diagnostics;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace CPinfoSafe
{
public sealed class NotificationIcon
{
private NotifyIcon notifyIcon;
private ContextMenu notificationMenu;
DialogResult dr;
#region Initialize icon and menu
public NotificationIcon()
{
notifyIcon = new NotifyIcon();
notificationMenu = new ContextMenu(InitializeMenu());
notifyIcon.DoubleClick += IconDoubleClick;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotificationIcon));
notifyIcon.Icon = (Icon)resources.Get
- 2022-11-01 19:35:03下载
- 积分:1
-
C# 使用DrawPolygon方法绘制一个多边形
C# 调用Graphics对象的DrawPolygon方法绘制一个多边形,我们用代码定义多边形的每条边:Point point6 = new Point(160, 20); //实例化Point类,注意多边形的每个边都需要定义不同数据。
Point[] myPoints ={ point1, point2, point3, point4, point5, point6 };//创建Point结构数组
//调用Graphics对象的DrawPolygon方法绘制一个多边形
ghs.DrawPolygon(myPen, myPoints);
- 2022-02-03 12:31:32下载
- 积分:1
-
C# 清除IE地址栏中的历史网址(修改注册表)
C# 清除IE地址栏中的历史网址,也就是历史记录,这些记录都是平时自己输入的,IE会自动保存,本程序会把保存的这些网址信息全部删除了,主要是删除注册表中对应键值下的URL子键:
RegistryKey rkBase = Registry.CurrentUser;//定位到CurrentUser注册表项
//打开指定的注册表项
RegistryKey rkChild = rkBase.OpenSubKey(@"SoftwareMicrosoftInternet ExplorerTypedURLs",true);
String[] strValueNames = rkChild.GetValueNames();//获取所有的历史网址
foreach (string strItem in strValueNames)//遍历获取到的历史网址
{
rkChild.DeleteValue(strItem);//删除遍历到的历史网址
}
- 2022-11-06 13:05:04下载
- 积分:1
-
C# wpf 创建简单形状动画的例子
C# wpf 创建简单形状动画的例子,启动动画、停止动画、暂停动画、继续动画、加速动画。创建动画
Rectangle MyRectangle = new Rectangle();
MyRectangle.Width = 50;
MyRectangle.Height = 20;
MyRectangle.Margin = new Thickness(10, 50, 0, 0);
MyRectangle.Fill = new LinearGradientBrush(
Color.FromArgb(255, 0, 255, 255), Color.FromArgb(255, 0, 0, 255), 0);
MyRectangle.HorizontalAlignment = HorizontalAlignment.Left;
this.canvas1.Children.Add(MyRectangle);
this.RegisterName("MyRectangle", MyRectangle);
DoubleAnimation MyAnimation =
new DoubleAnimation(100, 380, new Duration(TimeSpan.FromSeconds(5)));
Storyboard.SetTargetName(MyAnimation, "MyRectangle");
Storyboard.SetTargetProperty(MyAnimation,
new PropertyPath(Rectangle.WidthProperty));
MyStoryboard = new Storyboard();
MyStoryboard.Children.Add(MyAnimation);
动画效果请参见下图所示,源代码请单击下载按钮下载。
- 2022-08-25 13:04:57下载
- 积分:1
-
C# 实现Email邮件提醒器功能
C# 实现Email邮件提醒器功能,主程序分为设置窗口、提醒窗口和托盘窗口,运行后在Windows托盘处隐藏,右键托盘图标会调用出设置窗口,如截图所示。通过设置窗口输入相关监测的Email邮件参数,比如邮件服务器地址、端口地址、用户名、密码和检测邮件的时间间隔等。如果设置正确,则目标email中若接收到新邮件,会自动弹出提醒窗口。
- 2022-10-14 19:50:02下载
- 积分:1
-
PIXHAWK_Firmware-master 1.39版源码
PIXHAWK_Firmware-master 1.39版最新源码,希对您有所帮助.
- 2023-04-20 04:10:14下载
- 积分:1
-
C# 禁止鼠标左键单击的实现源码
C# 禁止鼠标左键单击,附上例子源码,禁止后将不响应鼠标左键消息,当然也可恢复鼠标左键,直接关闭本程序即可恢复,实现方法也很简单,看如下代码:
private void button1_Click(object sender, EventArgs e)
{//禁止鼠标左键单击
Application.AddMessageFilter(this);
MessageBox.Show("鼠标左键已经被禁止,请用Tab键执行操作!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void button2_Click(object sender, EventArgs e)
{//允许鼠标左键单击
Application.RemoveMessageFilter(this);
MessageBox.Show("鼠标左键已经被解禁,可以执行操作!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public bool PreFilterMessage(ref System.Windows.Forms.Message MySystemMessage)
{//不响应鼠标左键消息
if (MySystemMessage.Msg >= 513 && MySystemMessage.Msg
- 2022-03-09 09:45:43下载
- 积分:1