InkCanvas에서 복잡한 복합 모양 1 개를 만들려고하는데, 내가 예상했던대로 잘못된 것을해야합니다. 그렇지 않습니다. 나는 이것을 달성하기 위해 여러 가지 다른 화신을 시도했다.(Composite) C#의 기하학 혼란
그래서이 방법이 있습니다. http://img72.imageshack.us/img72/1286/actual.png
을 어디 내가 잘못 갈거야 :
private void InkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
{
Stroke stroke = e.Stroke;
// Close the "shape".
StylusPoint firstPoint = stroke.StylusPoints[0];
stroke.StylusPoints.Add(new StylusPoint() { X = firstPoint.X, Y = firstPoint.Y });
// Hide the drawn shape on the InkCanvas.
stroke.DrawingAttributes.Height = DrawingAttributes.MinHeight;
stroke.DrawingAttributes.Width = DrawingAttributes.MinWidth;
// Add to GeometryGroup. According to http://msdn.microsoft.com/en-us/library/system.windows.media.combinedgeometry.aspx
// a GeometryGroup should work better at Unions.
_revealShapes.Children.Add(stroke.GetGeometry());
Path p = new Path();
p.Stroke = Brushes.Green;
p.StrokeThickness = 1;
p.Fill = Brushes.Yellow;
p.Data = _revealShapes.GetOutlinedPathGeometry();
selectionInkCanvas.Children.Clear();
selectionInkCanvas.Children.Add(p);
}
는 그러나 이것은 내가 무엇을 얻을?
TIA, 에드
당신이 무엇을 원하는가 이루다?? –
무엇이 내 마음 속에서 일어날 것입니까? http://img685.imageshack.us/img685/6761/expected.png –