private void ellipseToolStripMenuItem_Click(object sender, EventArgs e) { HDrawingObject ellipse = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.ELLIPSE, 50, 50, 0, 100, 50); ellipse.SetDrawingObjectParams("color", "blue"); AttachDrawObj(ellipse); }
private void circleToolStripMenuItem_Click(object sender, EventArgs e) { HDrawingObject circle = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.CIRCLE, 200, 200, 70); circle.SetDrawingObjectParams("color", "magenta"); AttachDrawObj(circle); }
private void rectangle2ToolStripMenuItem_Click(object sender, EventArgs e) { HDrawingObject rect2 = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.RECTANGLE2, 100, 100, 0, 100, 50); rect2.SetDrawingObjectParams("color", "yellow"); AttachDrawObj(rect2); }
private void rectangle1ToolStripMenuItem_Click(object sender, EventArgs e) { HDrawingObject rect1 = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.RECTANGLE1, 100, 100, 210, 210); rect1.SetDrawingObjectParams("color", "green"); AttachDrawObj(rect1); }
private void BtnDrawCircle_Click(object sender, EventArgs e) { HDrawingObject circle = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.CIRCLE, 200, 200, 70); circle.SetDrawingObjectParams("color", "green"); visionControl1.AddOperations(cboOpera.Text); visionControl1.AttachDrawObj(circle); }
private void BtnDrawLine_Click(object sender, EventArgs e) { HDrawingObject line = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.LINE, 100, 100, 210, 210); line.SetDrawingObjectParams("color", "green"); visionControl1.AddOperations(cboOpera.Text); visionControl1.AttachDrawObj(line); }
private void BtnDrawRectangle2_Click(object sender, EventArgs e) { HDrawingObject rect2 = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.RECTANGLE2, 100, 100, 0, 100, 50); rect2.SetDrawingObjectParams("color", "green"); visionControl1.AddOperations(cboOpera.Text); visionControl1.AttachDrawObj(rect2); }
private void BtnDrawRectangle1_Click(object sender, EventArgs e) { HDrawingObject rect1 = HDrawingObject.CreateDrawingObject( HDrawingObject.HDrawingObjectType.RECTANGLE1, 100, 100, 210, 210); // rect1.GetDrawingObjectParams(r); rect1.SetDrawingObjectParams("color", "green"); visionControl1.AddOperations(cboOpera.Text); visionControl1.AttachDrawObj(rect1); }
void createRegion(double x1, double y1, double theta, double x2, double y2) { if (Drawing_Ob != null) { Drawing_Ob.Dispose(); } Drawing_Ob = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.RECTANGLE2, x1, y1, theta, x2, y2); Drawing_Ob.SetDrawingObjectParams("color", "green"); Drawing_Ob.OnDrag(getposistion); window.AttachDrawingObjectToWindow(Drawing_Ob); }
private void dashedToolStripMenuItem_Click(object sender, EventArgs e) { if (roi_object != null) { roi_object.SetDrawingObjectParams(new HTuple("line_style"), new HTuple(20, 5)); } }
private void DrawRectangle(object sender, EventArgs e) { HTuple width, height; background_image = new HImage(ho_Image); background_image.GetImageSize(out width, out height); VideoWindow_hWindowControl.HalconWindow.SetPart(0, 0, height.I - 1, width.I - 1); VideoWindow_hWindowControl.HalconWindow.AttachBackgroundToWindow(background_image); GraphInteractiveObect.halconWindow.Focus(); GraphInteractiveObect.graphic_stackClear(); VideoWindow_hWindowControl.HalconWindow.ClearWindow(); ObjectRoi = HDrawingObject.CreateDrawingObject(HDrawingObject.HDrawingObjectType.RECTANGLE2, ImageHeight / 2, ImageWidth / 2, 0, 300, 150); ObjectRoi.SetDrawingObjectParams("color", "yellow"); GraphInteractiveObect.AttachDrawObj(ObjectRoi); }
private void BtnLoadRoi_Click(object sender, EventArgs e) { OpenFileDialog f = new OpenFileDialog(); f.Filter = "ROI文件(.roi)|*.roi;"; HTuple[] _params; if (f.ShowDialog() == DialogResult.OK) { List <ROI> r = LoadRoi(f.FileName); foreach (ROI region in r) { _params = new HTuple[region.data.Count]; for (int i = 0; i < region.data.Count; i++) { _params[i] = region.data[i]; } HDrawingObject obj = HDrawingObject.CreateDrawingObject(region.type, _params); obj.SetDrawingObjectParams("color", "green"); visionControl1.AddOperations(region.operation); visionControl1.AttachDrawObj(obj); } } }