资源简介
基于GDI+的图元绘制拾取 C#实现
程序效果如博客http://blog.csdn.net/small_fish__/article/details/7394304所见

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace DrawmetaGraph
{
class Circle : metaTypeGraph
{
private Graphics graphics;
private int radius;
//构造方法
public Circle(Graphics graphics Point upLeftCoordinate)
{
this.fillColor = Color.Red; //默认填充色
this.radius = 25;
this.graphics = graphics;
this.upLeftCoordinate = upLeftCoordinate;
}
//重写的鼠标点击事件响应
public override void MouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
isSelected = inSidePolygon(new Point(e.X e.Y));
}
else
{
isSelected = false;
}
draw();
}
//判断鼠标是否选中图元
private bool inSidePolygon(Point p)
{
int dx = p.X - (upLeftCoordinate.X + radius);
int dy = p.Y - (upLeftCoordinate.Y + radius);
if ((dx*dx + dy*dy) < radius*radius )
return true;
else
return false;
}
//重写绘画的方法
public override void draw()
{
if (isSelected == true)
{
graphics.FillPie(new SolidBrush(choosedColor) upLeftCoordinate.X upLeftCoordinate.Y 2*radius 2*radius 0 360);
}
else
{
graphics.FillPie(new SolidBrush(fillColor) upLeftCoordinate.X upLeftCoordinate.Y 2*radius 2*radius 0 360);
}
}
public int Radius
{
get { return radius; }
set { radius = value; }
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17408 2012-03-06 13:17 Drawme
文件 54784 2012-03-06 13:17 Drawme
文件 11600 2012-03-24 20:54 Drawme
文件 490 2009-08-31 00:40 Drawme
文件 1991 2012-03-06 12:27 Drawme
文件 3885 2012-03-04 19:17 Drawme
文件 4544 2012-03-06 13:17 Drawme
文件 11885 2012-03-06 13:14 Drawme
文件 5817 2012-03-06 13:14 Drawme
文件 2819 2012-03-04 20:47 Drawme
文件 588 2012-03-04 20:49 Drawme
文件 4440 2012-03-04 16:18 Drawme
文件 6238 2012-03-06 13:17 Drawme
文件 787 2012-03-24 20:54 Drawme
文件 17408 2012-03-06 13:17 Drawme
文件 180 2012-03-06 13:14 Drawme
文件 54784 2012-03-06 13:17 Drawme
文件 180 2012-03-04 19:17 Drawme
文件 232 2012-03-06 13:14 Drawme
文件 586 2012-03-06 13:14 Drawme
文件 7897 2012-03-04 16:20 Drawme
文件 494 2012-03-04 09:40 Drawme
文件 1358 2012-03-04 09:40 Drawme
文件 2876 2012-03-04 09:40 Drawme
文件 5612 2012-03-04 09:40 Drawme
文件 1098 2012-03-04 09:40 Drawme
文件 249 2012-03-04 09:40 Drawme
文件 2285 2012-03-06 12:27 Drawme
文件 3778 2012-03-06 12:46 Drawme
文件 17408 2012-03-05 15:32 Drawme
............此处省略15个文件信息
相关资源
- C#使用GDI 绘制汽车车速表等量表源代
- c# GDI+画图用鼠标绘制直线、矩形、椭
- C# 使用GDI+绘制漂亮的ToolTip控件
- 简易停车场管理小程序
- winform做的流程图编辑器-GDI+绘图技术
- 超全的C# GDI+画图板
- c# gdi+ 地图绘制
- C#写的GDI+画板,功能齐全
- C#矢量图形开发范例
- C#_Winform中使用GDI+及双缓冲技术绘制正
- GDI+图像程序设计(PDF 含详细目录& 源
- C#闹钟&&时钟小程序源代码
- C# GDI+图形程序设计》随书源码完整版
- C#绘制动态二维平面坐标系
- C# GDI+ Demo.zip
- C#中GDI+实现简单二维矢量图编辑器教
- c#赛车游戏很实用
- C#开发cad画图软件 GDI+
- C#流程图编程演示(用GDI+实现鼠标绘
- 基于C#的波形显示控件的实现源码
- 用VS2010做的绘图板C#
- C# 画图工具鼠标拖动方式
- C#用GDI+画图经典案例不下后悔
- c# 绘制3D可旋转旋转矩形
- C#中使用双缓冲以及BitBlt提高GDI+绘图
- _01_DllPrctise.zip
- C#中GDI+实现简单二维矢量图编辑器教
- 曲线生成算法的C#gdi+实现贝塞尔曲线
- C# GDI+实时动态曲线绘制
- c#GDI+画点最简单的处理方式
评论
共有 条评论