各位大侠:
你们好!我通过打开图片在pictureBox打开了一张图片,想在这张图片上画圆,也就是把圆形目标区域标注出来,怎么写啊?万分感谢各位回复~
你们好!我通过打开图片在pictureBox打开了一张图片,想在这张图片上画圆,也就是把圆形目标区域标注出来,怎么写啊?万分感谢各位回复~
解决方案 »
- 【讨论】在 C# 项目中 添加引用
- 如何在ASP.net中创建Excel并设置Excel导出样式
- 焦点转移问题
- 有没有wiform类似msn提醒的控件,还有写好的服务如何在我打包好的程序安装时也安装 谢谢
- WinFrom多窗体间如何实现for循环切换,在线等啊,急?
- Winform中,在DataGridColumnStyle的单元格中怎么使用label控件??在线等待,解决马上给分
- 怎样将PKCS8编码的私钥文件读进来并转化为.net能用的私钥?
- QQ聊天发信息
- 在C#中有一个pannel控件,我现在想在上面画矩形,当画完一个矩形,要记住矩形的位置以及大小,松开鼠标后矩形消失!怎么弄?请教高手!
- 在C#中,有谁用过MSFlexGrid控件?
- 请问 正则表达式高手 能不能编写一个比较全面识别数字的正则表达
- 在vs2005中使用Microsoft.Interoperability报错 听说是跟vs2010有关
{
InitializeComponent();
pictureBox1.Paint+=new PaintEventHandler(pictureBox1_Paint);
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics a = e.Graphics;
a.DrawEllipse(new Pen(Color.Red, 5), 100, 50, 100, 100);
}
然后画
{
MWCharArray FileName = imagePath;
MWArray max=test.appleDetection((MWArray)FileName);
double[,] feature = (double[,])((MWNumericArray)max).ToArray(MWArrayComponent.Real);
//获取目标属性矩阵feature的行、列数
int featureRow = feature.GetLength(0);
int featureColumn = feature.GetLength(1);
//用feature的值在pictureBox1的图片上画圆
Bitmap bmp = new Bitmap(pictureBox1.Image, pictureBox1.Width, pictureBox1.Height);
Graphics g = Graphics.FromImage(bmp);
for (int i=0;i<featureColumn;i++)
{
g.DrawEllipse(new Pen(Color.Red, 10),(int) feature[0, i], (int)feature[1, i], (int )feature[2, i], (int)feature[2, i]);
}以上是我的完整代码,我试了下,怎么画不上去啊??希望各位再次分享经验!
你为啥不直接Graphics g = Graphics.FromImage(pictureBox1.Image);
{
MWCharArray FileName = imagePath;
MWArray max=test.appleDetection((MWArray)FileName);
double[,] feature = (double[,])((MWNumericArray)max).ToArray(MWArrayComponent.Real);
//获取目标属性矩阵feature的行、列数
int featureRow = feature.GetLength(0);
int featureColumn = feature.GetLength(1);
//用feature的值在pictureBox1的图片上画圆
Bitmap bmp = new Bitmap(pictureBox1.Image, pictureBox1.Width, pictureBox1.Height);
Graphics g = Graphics.FromImage(bmp);
for (int i=0;i<featureColumn;i++)
{
g.DrawEllipse(new Pen(Color.Red, 10),(int) feature[0, i], (int)feature[1, i], (int )feature[2, i], (int)feature[2, i]);
}以上是我的完整代码,我试了下,怎么画不上去啊??希望各位再次分享经验!