finished candybox
This commit is contained in:
@@ -52,6 +52,53 @@ namespace Lindt.Candybox.Demo
|
||||
|
||||
maskControl1.Mask = matContours2.ToBitmap();
|
||||
maskControl1.Original = original.Clone().ToBitmap();
|
||||
maskControl1.VectorLines = _recipe.LearnedParameters.Cuts.Select(x=>x.Scale(1800f/512f, 1408f/512f)).ToList();
|
||||
// Set default mode to Brush
|
||||
SetMode(EditMode.Brush);
|
||||
}
|
||||
|
||||
private void SetMode(EditMode mode)
|
||||
{
|
||||
maskControl1.CurrentMode = mode;
|
||||
|
||||
// Reset button colors
|
||||
btnBrush.Primary = mode==EditMode.Brush;
|
||||
btnDrawLine.Primary = mode==EditMode.DrawLine;
|
||||
btnRemoveLine.Primary = mode==EditMode.RemoveLine;
|
||||
btnMoveLine.Primary = mode==EditMode.MoveLine;
|
||||
btnMoveVertices.Primary = mode==EditMode.MoveVertices;
|
||||
btnBrush.Invalidate();
|
||||
btnDrawLine.Invalidate();
|
||||
btnRemoveLine.Invalidate();
|
||||
btnMoveLine.Invalidate();
|
||||
btnMoveVertices.Invalidate();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnBrush_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMode(EditMode.Brush);
|
||||
}
|
||||
|
||||
private void btnDrawLine_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMode(EditMode.DrawLine);
|
||||
}
|
||||
|
||||
private void btnRemoveLine_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMode(EditMode.RemoveLine);
|
||||
}
|
||||
|
||||
private void btnMoveLine_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMode(EditMode.MoveLine);
|
||||
}
|
||||
|
||||
private void btnMoveVertices_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMode(EditMode.MoveVertices);
|
||||
}
|
||||
|
||||
private void materialRaisedButton3_Click(object sender, EventArgs e)
|
||||
@@ -63,7 +110,7 @@ namespace Lindt.Candybox.Demo
|
||||
}
|
||||
|
||||
_recipe.LearnedParameters.Configuration.MemoryBuffer = (int)udMemoryBuffer.Value;
|
||||
_recipe.LearnContours(contours.ToArray(), _original);
|
||||
_recipe.LearnContours(contours.ToArray(), _original,maskControl1.VectorLines.Select(x=>x.Scale(512f/1800f, 512f/1408f)).ToList());
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user