
C#
ima_zhan
软件
展开
-
texturebrush 创建时提示内存不足
今天使用了一下texturebrush,using (Brush imgbrs = new TextureBrush(bmp, WrapMode.Tile, new Rectangle(0, 0, rect.Width, rect.Height))) { g.Fill原创 2011-08-15 15:39:34 · 1989 阅读 · 0 评论 -
过滤列表
点击打开链接转载 2012-06-04 16:43:02 · 443 阅读 · 0 评论 -
float的精度问题
今天发现了一个有意思的问题,用float.Parse("-0.03"); 得到的float型数据是-0.03,但是乘上100赋值给一个整数就成了-2. float fval = float.Parse("-0.03"); int ival = (int)(fval*100); 如果使用double就没问题。在64位的win7系统上也没问题。原创 2012-09-11 09:43:08 · 536 阅读 · 0 评论 -
RichTextbox保存为图片
FileStream pngfs = new FileStream("C:\\1.png", FileMode.OpenOrCreate);RenderTargetBitmap rtb = new RenderTargetBitmap((int)richTextBox1.ActualWidth, (int)richTextBox1.ActualHeight,转载 2014-09-05 23:28:22 · 2458 阅读 · 0 评论 -
ODBC 执行存储过程获取返回值
sql2005存储过程,通过不同的返回值(整型)表示不同的结果。但是在使用OdbcCommand调用该存储过程时,获取到的返回值始终不对。代码如下:OdbcCommand cmd = new OdbcCommand("{call CP_CreateUser(?,?,?)}", _OdbcConnection);cmd.CommandType = CommandType.Stored原创 2014-08-10 00:36:26 · 2145 阅读 · 0 评论 -
WPF 使用PathGeometry画时针和分针
// 将角度转为弧度 private double TransOrt2Radian(double fOrt) { double fPAI = 3.1415926535; double fTmp = fOrt + 270; if (fTmp > 360.0) fTmp -= 360.0;原创 2014-09-15 22:28:33 · 1701 阅读 · 0 评论 -
RichTextbox 操作
FlowDocument fd = richTextBox1.Document; System.IO.Stream s = new System.IO.MemoryStream(); System.Windows.Markup.XamlWriter.Save(fd, s); byte[] data = new byte[转载 2014-09-01 22:37:28 · 832 阅读 · 0 评论 -
wpf 打开外部程序并在需要时激活
打开外部程序使用Process激活窗体,通过SetForegroundWindow函数传递Process获取的句柄激活_external = new Process();[DllImport("User32.dll", EntryPoint = "SetForegroundWindow")] public static extern int SetForegro原创 2014-12-21 11:56:38 · 1406 阅读 · 0 评论 -
vs2019 winform CLR20R3错误
在win10环境下编写了一个winform的程序,到2008上运行,报CLR20R3的错误。安装了.net环境,还是无法解决,后来在系统日志中发现是一个控件的错误,没有注册。看来要养成看日志的习惯。具体可以参见这位仁兄的博客,https://blog.youkuaiyun.com/menghuangxiao/article/details/54915149...原创 2019-09-10 13:50:36 · 1337 阅读 · 0 评论