Thank you very much,Slavcho
I have the following questions:
1.After compilation, the output bar prompts that the Utilities object in the function DistToRect does not exist. Is it necessary to add additional libraries?
2.How to change the style of ShapeNode after being selected by the mouse and how to change its size?As shown in Figure 1.
3.I need to hold down Ctrl and click the left mouse button on the ShapeNode to drag to generate rectangle 3. So I implemented it like this:
if (Keyboard.Modifiers == ModifierKeys.Control)
{
diagram.Behavior = Behavior.DrawShapes;
}
put it in the NodeClicked event. But it doesn't work. The result is that you can directly click the mouse and drag on the ShapeNode without holding down Ctrl. Obviously this is not the result I want. What corrections need to be made? And I need to modify the generation of rectangle 3 from the existing ellipse to rectangle. As shown in Figure 2.
4.I want to double-click any item in the treeview in one tabControl to switch to another tabControl, as shown in Figure 3 and Figure 4. I want to implement it. The idea I thought of is to create another Window to save the second tabControl, and then perform the first tabControl and the second tabControl to switch between the two Windows, but what I can’t figure out is How can the second form be placed on the Grid position of the first tabControl? Is my thinking wrong? How should I achieve it?
5.I try to convert the Image type of ShapeNode to the Mat type of OpenCvShape, and the parameter type of the conversion function requires Bitmap type. Shouldn't the Image type of ShapeNode be the Bitmap type? It was created using new BitmapImage. Why did it report an error: Cannot convert from "System.Windows.Media.ImageSource" to "System.Drawing.Bitmap". What is the reason and how to correct it? As shown in Figure 5 and Figure 6.
6.I use this code to switch the focus of the mouse between ShapeNodes at will, but as shown in Figure 7, the mouse still cannot select the inner ShapeNode, but can only select the outer one. What changes need to be made?
Best regards.