2011年7月29日
摘要: 下面将演示如何使用窗体的默认字体。 privatevoidForm1_Paint(objectsender,PaintEventArgse){FontFamilyff=newFontFamily(GenericFontFamilies.SansSerif);Fontf=newFont(ff,13,GraphicsUnit.Millimeter);Fontf1=newFont(ff,13,GraphicsUnit.Point);using(Fontf2=newFont(ff,23,FontStyle.Strikeout)){Graphicsg=e.Graphics;g.DrawString(&q 阅读全文
posted @ 2011-07-29 23:58 wtq 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 可通过钢笔和笔刷混合 使用绘制出有边框的填充图案,如图:代码如下:View Code privatevoidForm1_Paint(objectsender,PaintEventArgse){Graphicsg=e.Graphics;HatchBrushhb=newHatchBrush(HatchStyle.NarrowHorizontal,Color.Blue,Color.White);LinearGradientBrushlgb=newLinearGradientBrush(newPoint(2,2),newPoint(19,2),Color.Blue,Color.Brown);Penh. 阅读全文
posted @ 2011-07-29 21:52 wtq 阅读(400) 评论(0) 推荐(1) 编辑
摘要: 先上图:提示:可通过笔刷来创建钢笔并绘制图形,以上是通过HatchBrush 来创建钢笔的。View Code privatevoidForm1_Paint(objectsender,PaintEventArgse){Graphicsg=e.Graphics;HatchBrushhb=newHatchBrush(HatchStyle.NarrowHorizontal,Color.Red,Color.White);Penhp=newPen(hb,8);g.DrawRectangle(hp,12,12,200,200);hb.Dispose();}还可以通过LinearGridentBrush来. 阅读全文
posted @ 2011-07-29 21:40 wtq 阅读(472) 评论(1) 推荐(0) 编辑
摘要: 先上图:通过hatchbrush根据图案来填充,可通过HatchStyle枚举来设置图案。 代码如下:View Code privatevoidForm1_Paint(objectsender,PaintEventArgse){Graphicsg=e.Graphics;HatchBrushhb=newHatchBrush(HatchStyle.OutlinedDiamond,Color.Red,Color.White);g.FillRectangle(hb,ClientRectangle);hb.Dispose();} 阅读全文
posted @ 2011-07-29 20:51 wtq 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 通过路径渐变画刷来绘制图片代码如下:View Code privatevoidForm1_Paint(objectsender,PaintEventArgse){Graphicsg=e.Graphics;GraphicsPathgp=newGraphicsPath();Point[]p=newPoint[]{newPoint(10,10),newPoint(100,30),newPoint(50,100)};gp.AddLines(p);PathGradientBrushpgb=newPathGradientBrush(gp);pgb.CenterColor=Color.White;pgb.. 阅读全文
posted @ 2011-07-29 20:40 wtq 阅读(1560) 评论(0) 推荐(0) 编辑
摘要: 在linq 中实现 sql 中的in查询时,可以使用如下语句:View Code ///intPropertySetId))();}Ls.ToList();<summary>///根据行业id获得属性集名///</summary>///<paramname="strPropertySetId"></param>///<returns></returns>publicList<string>GetHyNametByPromotionForWeb(List<int?>{if(intP 阅读全文
posted @ 2011-07-29 14:38 wtq 阅读(5302) 评论(0) 推荐(0) 编辑