GDI+ 绘制砂岩含量图版
图版是在工作中经常会使用到的工具,它能够大大提高我们日常工作效率。地质图版在地质工作中具有举足轻重的作用,不仅可以轻松判断岩性,也可以依据经验图版直接得到结果,十分方便。
本程序目的绘制出一个地质常用三角图版:砂岩含量图版。图版的每个角代表每种含量,目标图版如下:
程序源代码下载地址见文章末尾。
首先建立一个TrianglePlate类。确定TrianglePlate类的属性两个:三角形中心(Center)和三角形边长(SideLength)。
/// <summary>
/// 三角形图版内心
/// </summary>
public PointF Center { set; get; } /// <summary>
/// 三角形图版边长
/// </summary>
public float SideLength { get; set; }
定义一个PointF数组代表三角形图版三个点的具体坐标,采用PointF类型的原因是PointF比Point更加精确,能够保证图像的精度。为了对类进行封装,坐标数组采用private类型。
private PointF[] _points;
TrianglePlate类的构造函数如下:
public TrianglePlate(PointF center, float sidelength)
{
this.Center = center;
this.SideLength = sidelength;
this.Scale = sacle; //计算三个点
_points = new PointF[];
_points[] = new PointF(this.Center.X - this.SideLength/,
(float) (this.Center.Y - this.SideLength/(*Math.Sqrt()))
);
_points[] = new PointF(this.Center.X + this.SideLength/,
(float) (this.Center.Y - this.SideLength/(*Math.Sqrt()))
);
_points[] = new PointF(this.Center.X,
(float) (this.Center.Y - *this.SideLength/(Math.Sqrt()))
);
}
为了更好绘制图形,向TrianglePlate类加入DrawTrianglePlate方法,方便图形的绘制。
/// <summary>
/// 绘制三角形图版
/// </summary>
public void DrawTrianglePlate (Graphics g)
{
DrawSildes (g);
} /// <summary>
/// 绘制三角形图版三边
/// </summary>
private void DrawSildes (Graphics g)
{
g.DrawLine (this.SidePen, _points[], _points[]);
g.DrawLine (this.SidePen, _points[], _points[]);
g.DrawLine (this.SidePen, _points[], _points[]);
}
在From进行TrianglePlate初始化后,就可以调用Form的Paint函数进行绘制了。
public FrmMain()
{
InitializeComponent();
tp.SidePen = new Pen (Color.Black, );
tp.SidePen.StartCap = LineCap.Round;
tp.SaclePen = new Pen (Color.Black, ); } TrianglePlate tp = new TrianglePlate (new PointF (, ), ); private void tabPage1_Paint (object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
tp.DrawTrianglePlate (g, pcoursor); myBuffer.Render (e.Graphics);
g.Dispose();
myBuffer.Dispose(); //释放资源
}
一个简单的三角形就绘制完成了,如下:
接下来进行绘制三角形图版的倾斜刻度线,定义一个float数组Scale用来存储刻度值,方便使用。定义一个PointF数组_scalepoints用来存储刻度线与三角形边框相交的点。
public float[] Scale { get; set; }
private PointF[] _scalepoints;
对Scale和_scalepoints的初始化操作放在构造函数DrawTrianglePlate中。修改后的构造函数如下:
public TrianglePlate (PointF center, float sidelength, float[] sacle)
{
this.Center = center;
this.SideLength = sidelength;
this.Scale = sacle; //计算三个点
_points = new PointF[];
_points[] = new PointF (this.Center.X - this.SideLength / ,
(float) (this.Center.Y - this.SideLength / ( * Math.Sqrt () ) )
);
_points[] = new PointF (this.Center.X + this.SideLength / ,
(float) (this.Center.Y - this.SideLength / ( * Math.Sqrt () ) )
);
_points[] = new PointF (this.Center.X,
(float) (this.Center.Y - * this.SideLength / (Math.Sqrt () ) )
); //计算刻度点
_scalepoints = new PointF[];
_scalepoints[] = new PointF (_points[].X + sidelength * this.Scale[], _points[].Y);
_scalepoints[] = new PointF (_points[].X + sidelength * this.Scale[], _points[].Y);
_scalepoints[] = new PointF (_points[].X + sidelength * ( - this.Scale[]), _points[].Y);
_scalepoints[] = new PointF (_points[].X + sidelength * ( - this.Scale[]), _points[].Y);
_scalepoints[] = new PointF (_points[].X - (float) (sidelength / ) * this.Scale[],
_points[].Y + (float) (sidelength * Math.Sqrt () / ) * this.Scale[]);
_scalepoints[] = new PointF (_points[].X - (float) (sidelength / ) * this.Scale[],
_points[].Y + (float) (sidelength * Math.Sqrt () / ) * this.Scale[]);
_scalepoints[] = new PointF (_points[].X + (float) (sidelength / ) * this.Scale[],
_points[].Y + (float) (sidelength * Math.Sqrt () / ) * this.Scale[]);
_scalepoints[] = new PointF (_points[].X + (float) (sidelength / ) * this.Scale[],
_points[].Y + (float) (sidelength * Math.Sqrt () / ) * this.Scale[]); _scalepoints[] = new PointF (_points[].X,
_points[].Y - (0.5f - this.Scale[]) * this.SideLength * (float) Math.Sqrt () );
_scalepoints[] = new PointF (_points[].X,
_points[].Y - (0.5f - this.Scale[]) * this.SideLength * (float) Math.Sqrt () );
_scalepoints[] =
new PointF (_scalepoints[].X - (_scalepoints[].Y - _scalepoints[].Y) / / (float) Math.Sqrt (),
(_scalepoints[].Y + _scalepoints[].Y) / );
_scalepoints[] =
new PointF (_scalepoints[].X + (_scalepoints[].Y - _scalepoints[].Y) / / (float) Math.Sqrt (),
(_scalepoints[].Y + _scalepoints[].Y) / );
}
加入DrawScale函数绘制刻度线,并在DrawTrianglePlate绘制函数进行调用。
private void DrawScale (Graphics g)
{
g.DrawLine (this.SaclePen, _scalepoints[], _scalepoints[]);
g.DrawLine (this.SaclePen, _scalepoints[], _scalepoints[]);
g.DrawLine (this.SaclePen, _scalepoints[], _scalepoints[]);
g.DrawLine (this.SaclePen, _scalepoints[], _scalepoints[]);
}
接下来对图版的刻度和文字进行绘制。
private void DrawTag (Graphics g)
{
g.DrawString ("长石", new Font ("宋体", ), Brushes.Black, new PointF (_points[].X - 25f, _points[].Y - 25f) );
g.DrawString ("岩屑", new Font ("宋体", ), Brushes.Black, new PointF (_points[].X + 5f, _points[].Y - 25f) );
g.DrawString ("石英", new Font ("宋体", ), Brushes.Black, new PointF (_points[].X - 25f, _points[].Y - 15f) ); g.DrawString ( ( - this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X, _scalepoints[].Y + ) );
g.DrawString ( ( - this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X, _scalepoints[].Y + ) );
g.DrawString ( (this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X, _scalepoints[].Y + ) );
g.DrawString ( (this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X, _scalepoints[].Y + ) ); g.DrawString ( (this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X - 25f, _scalepoints[].Y - ) );
g.DrawString ( (this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X - 25f, _scalepoints[].Y - ) ); g.DrawString ( (this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X + 5f, _scalepoints[].Y - ) );
g.DrawString ( (this.Scale[] * ).ToString(), new Font ("宋体", ), Brushes.Black,
new PointF (_scalepoints[].X + 5f, _scalepoints[].Y - ) );
}
DrawTag函数在DrawTrianglePlate绘制函数中进行调用,此时形成图形如下:
接下来是最后一步,绘制随鼠标移动的动态刻度线。目的实现结果如下:
为此,首先需要判断鼠标是否点在图版内,并获得鼠标的位置。向DrawTriangle类添加成员函数MouseIsIn。其中tpgp是一个GraphicsPath类型的变量,利用GraphicsPath提供的IsVisible函数判断鼠标是否在Path内。
public bool MouseIsIn (Graphics g, PointF pt)
{
if (tpgp.IsVisible (pt) )
{
DrawDotDial (g, pt);
return true;
} else
return false;
}
然后根据鼠标点与已知的刻度点计算得出动态刻度点坐标。
private void DrawDotDial (Graphics g, PointF pt)
{
_dials = new PointF[];
float py = _points[].Y - pt.Y;
float px = pt.X - _points[].X; _dials[] = new PointF (pt.X - py / (float) Math.Sqrt (), _points[].Y);
_dials[] = new PointF (pt.X + py / (float) Math.Sqrt (), _points[].Y);
_dials[] = new PointF ( (_dials[].X + _points[].X) / ,
_dials[].Y - (_dials[].X - _points[].X) * (float) Math.Sqrt () / );
_dials[] = new PointF ( (_points[].X + _dials[].X) / ,
_points[].Y - (_points[].X - _dials[].X) * (float) Math.Sqrt () / );
_dials[] = new PointF (_points[].X + py / (float) Math.Sqrt (),
pt.Y);
_dials[] = new PointF (_points[].X - (_dials[].X - _points[].X),
pt.Y); Pen tmpen = new Pen (Color.Black, );
tmpen.DashStyle = DashStyle.Dash; g.DrawLine (tmpen, _dials[], _dials[]);
g.DrawLine (tmpen, _dials[], _dials[]);
g.DrawLine (tmpen, _dials[], _dials[]);
}
然后在DrawTrianglePlate函数内对DrawDotDial进行调用,就完成了。
完整代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D; namespace Ch_地质图版
{
class TrianglePlate
{
public TrianglePlate(PointF center, float sidelength, float[] sacle)
{
this.Center = center;
this.SideLength = sidelength;
this.Scale = sacle; //计算三个点
_points = new PointF[];
_points[] = new PointF(this.Center.X - this.SideLength/,
(float) (this.Center.Y - this.SideLength/(*Math.Sqrt()))
);
_points[] = new PointF(this.Center.X + this.SideLength/,
(float) (this.Center.Y - this.SideLength/(*Math.Sqrt()))
);
_points[] = new PointF(this.Center.X,
(float) (this.Center.Y - *this.SideLength/(Math.Sqrt()))
); //计算刻度点
_scalepoints = new PointF[];
_scalepoints[] = new PointF(_points[].X + sidelength * this.Scale[], _points[].Y);
_scalepoints[] = new PointF(_points[].X + sidelength * this.Scale[], _points[].Y);
_scalepoints[] = new PointF(_points[].X + sidelength * ( - this.Scale[]), _points[].Y);
_scalepoints[] = new PointF(_points[].X + sidelength * ( - this.Scale[]), _points[].Y);
_scalepoints[] = new PointF(_points[].X - (float)(sidelength / ) * this.Scale[],
_points[].Y + (float)(sidelength * Math.Sqrt() / ) * this.Scale[]);
_scalepoints[] = new PointF(_points[].X - (float)(sidelength / ) * this.Scale[],
_points[].Y + (float)(sidelength * Math.Sqrt() / ) * this.Scale[]);
_scalepoints[] = new PointF(_points[].X + (float)(sidelength / ) * this.Scale[],
_points[].Y + (float)(sidelength * Math.Sqrt() / ) * this.Scale[]);
_scalepoints[] = new PointF(_points[].X + (float)(sidelength / ) * this.Scale[],
_points[].Y + (float)(sidelength * Math.Sqrt() / ) * this.Scale[]); _scalepoints[] = new PointF(_points[].X,
_points[].Y - (0.5f - this.Scale[]) * this.SideLength * (float)Math.Sqrt());
_scalepoints[] = new PointF(_points[].X,
_points[].Y - (0.5f - this.Scale[]) * this.SideLength * (float)Math.Sqrt());
_scalepoints[] =
new PointF(_scalepoints[].X - (_scalepoints[].Y - _scalepoints[].Y) / / (float)Math.Sqrt(),
(_scalepoints[].Y + _scalepoints[].Y) / );
_scalepoints[] =
new PointF(_scalepoints[].X + (_scalepoints[].Y - _scalepoints[].Y) / / (float)Math.Sqrt(),
(_scalepoints[].Y + _scalepoints[].Y) / ); tpgp = new GraphicsPath();
tpgp.AddLines(_points); //DrawDotDial()
} /// <summary>
/// 三角形图版内心
/// </summary>
public PointF Center { set; get; } /// <summary>
/// 三角形图版边长
/// </summary>
public float SideLength { get; set; } /// <summary>
/// 三角形图版画边笔
/// </summary>
public Pen SidePen { get; set; } public Pen SaclePen { get; set; } public float[] Scale { get; set; } private PointF[] _points; private PointF[] _scalepoints; private GraphicsPath tpgp; private PointF[] _dials; public void DrawTrianglePlate(Graphics g,PointF tms)
{
DrawSildes(g);
DrawScale(g);
DrawTag(g);
if(!tms.IsEmpty)
DrawDotDial(g, tms);
} private void DrawSildes(Graphics g)
{
g.DrawLine(this.SidePen, _points[], _points[]);
g.DrawLine(this.SidePen, _points[], _points[]);
g.DrawLine(this.SidePen, _points[], _points[]);
} private void DrawScale(Graphics g)
{
g.DrawLine(this.SaclePen, _scalepoints[], _scalepoints[]);
g.DrawLine(this.SaclePen, _scalepoints[], _scalepoints[]);
g.DrawLine(this.SaclePen, _scalepoints[], _scalepoints[]);
g.DrawLine(this.SaclePen, _scalepoints[], _scalepoints[]);
} private void DrawTag(Graphics g)
{
//g.DrawString("①", new Font("楷体", 12), Brushes.Purple, _scalepoints[4].X, _scalepoints[4].Y);
//g.DrawString("②", new Font("楷体", 12), Brushes.Purple, _scalepoints[5].X, _scalepoints[5].Y);
//g.DrawString("③", new Font("楷体", 12), Brushes.Purple, _scalepoints[6].X, _scalepoints[6].Y);
//g.DrawLine(Pens.Black, _scalepoints[8], _scalepoints[11]);
//g.DrawLine(Pens.Black, _scalepoints[9], _scalepoints[10]); //GraphicsPath gp = new GraphicsPath();
//gp.AddLines(new PointF[] {_scalepoints[4], _scalepoints[8], _scalepoints[6], _points[2]});
//g.FillPath(Brushes.Red, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[4], _scalepoints[5], _scalepoints[9], _scalepoints[8] });
//g.FillPath(Brushes.Purple, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[6], _scalepoints[8], _scalepoints[10], _scalepoints[7] });
//g.FillPath(Brushes.Pink, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[8], _scalepoints[9], _scalepoints[11], _scalepoints[10] });
//g.FillPath(Brushes.RoyalBlue, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[5], _scalepoints[9], _scalepoints[0], _points[0] });
//g.FillPath(Brushes.SkyBlue, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[9], _scalepoints[11], _scalepoints[1], _scalepoints[0] });
//g.FillPath(Brushes.Green, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[11], _scalepoints[10], _scalepoints[3], _scalepoints[2] });
//g.FillPath(Brushes.Yellow, gp); //gp = new GraphicsPath();
//gp.AddLines(new PointF[] { _scalepoints[3], _scalepoints[10], _scalepoints[7], _points[1] });
//g.FillPath(Brushes.Tomato, gp); g.DrawString("长石", new Font("宋体", ), Brushes.Black, new PointF(_points[].X - 25f, _points[].Y - 25f));
g.DrawString("岩屑", new Font("宋体", ), Brushes.Black, new PointF(_points[].X + 5f, _points[].Y - 25f));
g.DrawString("石英", new Font("宋体", ), Brushes.Black, new PointF(_points[].X - 25f, _points[].Y - 15f)); g.DrawString(( - this.Scale[]*).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X, _scalepoints[].Y+));
g.DrawString(( - this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X, _scalepoints[].Y+));
g.DrawString((this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X, _scalepoints[].Y+));
g.DrawString((this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X, _scalepoints[].Y+)); g.DrawString((this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X-25f, _scalepoints[].Y-));
g.DrawString((this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X - 25f, _scalepoints[].Y - )); g.DrawString((this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X+5f, _scalepoints[].Y - ));
g.DrawString((this.Scale[] * ).ToString(), new Font("宋体", ), Brushes.Black,
new PointF(_scalepoints[].X + 5f, _scalepoints[].Y - )); } public bool MouseIsIn(Graphics g, PointF pt)
{
if (tpgp.IsVisible(pt))
{
DrawDotDial(g, pt);
return true;
} else
return false;
} private void DrawDotDial(Graphics g,PointF pt)
{
_dials = new PointF[];
float py = _points[].Y - pt.Y;
float px = pt.X - _points[].X; _dials[] = new PointF(pt.X - py/(float) Math.Sqrt(), _points[].Y);
_dials[] = new PointF(pt.X + py/(float) Math.Sqrt(), _points[].Y);
_dials[] = new PointF((_dials[].X + _points[].X)/,
_dials[].Y - (_dials[].X - _points[].X)*(float) Math.Sqrt()/);
_dials[] = new PointF((_points[].X + _dials[].X)/,
_points[].Y - (_points[].X - _dials[].X) * (float)Math.Sqrt() / );
_dials[] = new PointF(_points[].X + py / (float)Math.Sqrt(),
pt.Y);
_dials[] = new PointF(_points[].X-(_dials[].X-_points[].X),
pt.Y); Pen tmpen = new Pen(Color.Black, );
tmpen.DashStyle = DashStyle.Dash; g.DrawLine(tmpen, _dials[], _dials[]);
g.DrawLine(tmpen, _dials[], _dials[]);
g.DrawLine(tmpen, _dials[], _dials[]); //GetContentScale(pt);
//g.DrawLine(tmpen,pt, new Point(0, 0));
} private float[] GetContentScale(PointF pt)
{
float[] content = new float[];
content[] = (_dials[].X - _points[].X)/this.SideLength;
content[] = (_points[].X - _dials[].X) / this.SideLength;
//content[1] = content[1]/this.SideLength/this.SideLength;
content[] = Math.Abs(_points[].X - _dials[].X) * Math.Abs(_points[].X - _dials[].X) +
Math.Abs(_points[].Y - _dials[].Y) * Math.Abs(_points[].Y - _dials[].Y);
content[] = content[] / this.SideLength / this.SideLength;
//content[1] = Math.Sqrt((double)content[1]);
//Math.Sqrt((double)(Math.Abs(_points[2].X - _dials[3].X)*Math.Abs(_points[2].X - _dials[3].X)) +
// (double)(Math.Abs(_points[2].Y - _dials[3].Y)*Math.Abs(_points[2].Y - _dials[3].Y)
// ))/this.SideLength;
return content;
} public string GetScaleDes(PointF pt)
{
GraphicsPath gptmp = new GraphicsPath(); gptmp.AddLines(new PointF[] {_points[], _scalepoints[], _scalepoints[], _scalepoints[]});
if (gptmp.IsVisible(pt))
return "石英砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _scalepoints[] });
if (gptmp.IsVisible(pt))
return "长石石英砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _scalepoints[] });
if (gptmp.IsVisible(pt))
return "长石岩屑质石英砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _scalepoints[] });
if (gptmp.IsVisible(pt))
return "岩屑石英砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _points[] });
if (gptmp.IsVisible(pt))
return "长石砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _scalepoints[] });
if (gptmp.IsVisible(pt))
return "碎屑质长石砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[] });
if (gptmp.IsVisible(pt))
return "混合砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _scalepoints[] });
if (gptmp.IsVisible(pt))
return "长石质岩屑砂岩"; gptmp.AddLines(new PointF[] { _scalepoints[], _scalepoints[], _scalepoints[], _points[] });
if (gptmp.IsVisible(pt))
return "岩屑砂岩"; return "";
}
}
}
程序源代码地址:http://pan.baidu.com/s/1osgAU
GDI+ 绘制砂岩含量图版的更多相关文章
- 通过GDI+绘制 验证码
只为了记录下自己的学习历程,方便日后查看 现在开始言归正传,以下为其完整代码附上 using System; using System.Collections.Generic; using Syste ...
- C#利用GDI+绘制旋转文字等效果
C#中利用GDI+绘制旋转文本的文字,网上有很多资料,基本都使用矩阵旋转的方式实现.但基本都只提及按点旋转,若要实现在矩形范围内旋转文本,资料较少.经过琢磨,可以将矩形内旋转转化为按点旋转,不过需要经 ...
- C# 使用GDI+绘制漂亮的MenuStrip和ContextMenuStrip皮肤
通过上面的效果截图可以看到,重绘后的MenuStrip和ContextMenuStrip可以添加自己的LOGO信息,实现了类似OFFICE2007的菜单显示效果. .NET对菜单控件的绘制提供了一个抽 ...
- MFC 用gdi绘制填充多边形区域
MFC 用gdi绘制填充多边形区域 这里的代码是实现一个三角形的绘制,并用刷子填充颜色 在OnPaint()函数里面 运用的是给定的三角形的三个点,很多个点可以绘制多边形 CBrush br(RGB( ...
- GDI绘制时钟效果,与系统时间保持同步,基于Winform
2018年工作之余,想起来捡起GDI方面的技术,特意在RichCodeBox项目中做了两个示例程序,其中一个就是时钟效果,纯C#开发.这个CSharpQuartz是今天上午抽出一些时间,编写的,算是偷 ...
- 『备注』GDI+ 绘制文本有锯齿,透明背景文本绘制
背景: GDI+ 绘制文本 时,如果 背景是透明的 —— 则会出现 锯齿. //其实,我不用这三个 属性 好多年了 //而且,这三个属性 在关键时刻还有可能 帮倒忙 //关键是:这三个属性,鸟用都没有 ...
- C#GDI+ 绘制线段(实线或虚线)、矩形、字符串、圆、椭圆
C#GDI+ 绘制线段(实线或虚线).矩形.字符串.圆.椭圆 绘制基本线条和图形 比较简单,直接看代码. Graphics graphics = e.Graphics; //绘制实线 )) { pen ...
- C# GDI绘制仪表盘(纯代码实现)
纯代码实现GDI绘制仪表盘,效果在代码下面. public partial class HalfDashboardUc : UserControl { /// <summary> /// ...
- 如何使用GDI绘制半透明矩形
/*使用GDI绘制半透明矩形*/ void CDirectXDraw::DrawHalfOpacityRect(HDC hdc,CRect rect) { CDC dc; dc.Attach(hdc) ...
随机推荐
- Vertica的这些事(八)——-Vertica-管理
1.版本信息 dbadmin=> SELECT version(); version ------------------------------------ Vertica Analytic ...
- flink 一分钟入门篇
1. 业务说:“…… bulabula……,这个需求很简单,怎么实现我不管?” 面对霸气侧漏的业务需求,由于没有大数据知识储备,咱心里没底,咱也不敢问,咱也不敢说,只能静下来默默储备.默默寻觅解决方案 ...
- 人生苦短,学用python
1. 我为什么开始学着用 python 啦? 扯扯网上疯传的一组图片.网上流传<人工智能实验教材>的图片,为幼儿园的小朋友们量身打造的实验教材,可谓是火了.甚至有网友调侃道:pytho ...
- Kylin 初入门 | 从下载安装到体验查询
本文旨在为 Kylin 新手用户提供一份从下载安装到体验亚秒级查询的完整流程.文章分为两个部分,分别介绍了有 Hadoop 环境(基于 Hadoop 环境的安装)和没有 Hadoop 环境(从 Doc ...
- Android如何快速打出100个渠道apk
测试1分钟900多个包 关键思路就是读文件,如图: Python快速打包脚本: #!/usr/bin/env python import zipfile prefix = 'channel_' cha ...
- orm层面的删除的注意事项
orm层面的删除 当两张表的外键约束设置为RESTRICT or ACTION时,在sql的层面上想要删除父级表的数据时吗,mysql会拒绝删除,但是 使用orm的delete还是会删除父级表的数据. ...
- Linux命文件与目录属性
一.linux系统中文件标志 d ===> 目录 - ===> 文件 l ===> 连接文件 b ===> 可供存储设备文件 c ===> 串形端口设备文件(鼠标,键盘) ...
- C语言 文件操作(二)
1.fputc(); fputc 是 file output char 的所以,意思是向指定的文件中写入一个字符.fputc() 的用法为: int fputc ( int ch, FILE *fp ...
- NHibernate COUNT(*) 统计问题
NHibernate这个框架用了有一年多了,相对有很大的优势,可以省去很多写Sql的时间. 但是如果你想用它做统计,那么有点抱歉,只能手动写写了.它内置的东西很难符合你的需求. 我遇到的问题是这样的. ...
- Struts2-学习笔记系列(9)-OGNL类型转换和类型绑定
HTML: <s:form action="login"> <s:textfield name="user.name" label=" ...