Hello Mat

 找回密码
 立即注册
查看: 1364|回复: 0

画笔功能

[复制链接]

1299

主题

1525

帖子

114

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22657
发表于 2022-6-8 22:18:04 | 显示全部楼层 |阅读模式
画笔功能

  1.             //PictureBox pb = (PictureBox)Control.FromHandle(xx);
  2.             Graphics g = pictureBox1.CreateGraphics();
  3.             Pen pp = new Pen(Color.Green, 2);
  4.             g.DrawLine(pp, new Point(0, 0), new Point(100, 100));
  5.             // 一定释放!否则容易内存泄露
  6.             g.Dispose();
复制代码
方法二:
  1.             Graphics g = pictureBox1.CreateGraphics();
  2.             g.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));
  3.             // 一定释放!否则容易内存泄露
  4.             g.Dispose();
复制代码




算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-5-23 21:23 , Processed in 0.231129 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表