protected void CreateCanvas()
 {
     DrawingControl = new DrawingControl();
     DrawingControl.HorizontalAlignment  = HorizontalAlignment.Stretch;
     DrawingControl.VerticalAlignment    = VerticalAlignment.Stretch;
     DrawingControl.ReadyForInteraction += RaiseReadyForInteraction;
     DrawingControl.DrawingAttach       += DrawingControl_DrawingAttach;
     DrawingControl.DrawingDetach       += DrawingControl_DrawingDetach;
 }
Beispiel #2
0
 protected void CreateCanvas()
 {
     DrawingAdorner = new System.Windows.Documents.AdornerDecorator();
     DrawingControl = new DrawingControl();
     DrawingControl.HorizontalAlignment  = HorizontalAlignment.Stretch;
     DrawingControl.VerticalAlignment    = VerticalAlignment.Stretch;
     DrawingControl.ReadyForInteraction += RaiseReadyForInteraction;
     DrawingControl.DrawingAttach       += DrawingControl_DrawingAttach;
     DrawingControl.DrawingDetach       += DrawingControl_DrawingDetach;
     DrawingAdorner.Child = DrawingControl;
 }
Beispiel #3
0
 protected void CreateCanvas()
 {
     DrawingControl = new DrawingControl();
     DrawingControl.HorizontalAlignment = HorizontalAlignment.Stretch;
     DrawingControl.VerticalAlignment = VerticalAlignment.Stretch;
     DrawingControl.ReadyForInteraction += RaiseReadyForInteraction;
     DrawingControl.DrawingAttach += DrawingControl_DrawingAttach;
     DrawingControl.DrawingDetach += DrawingControl_DrawingDetach;
 }
Beispiel #4
0
 protected void CreateCanvas()
 {
     DrawingAdorner = new System.Windows.Documents.AdornerDecorator();
     DrawingControl = new DrawingControl();
     DrawingControl.HorizontalAlignment = HorizontalAlignment.Stretch;
     DrawingControl.VerticalAlignment = VerticalAlignment.Stretch;
     DrawingControl.ReadyForInteraction += RaiseReadyForInteraction;
     DrawingControl.DrawingAttach += DrawingControl_DrawingAttach;
     DrawingControl.DrawingDetach += DrawingControl_DrawingDetach;
     DrawingAdorner.Child = DrawingControl;
 }
Beispiel #5
0
        private void PrintPageHandler(object sender, PrintPageEventArgs e)
        {
            var printCanvas = new DrawingControl();
            printCanvas.Height = e.PrintableArea.Height;
            printCanvas.Width = e.PrintableArea.Width;
            printCanvas.LoadDrawing(DrawingSerializer.SaveDrawing(drawingHost.CurrentDrawing));

            var savedScaleSetting = DynamicGeometry.Settings.ScaleTextWithDrawing;
            DynamicGeometry.Settings.ScaleTextWithDrawing = true;   // Must be true for text to appear as expected.
            printCanvas.Drawing.Recalculate();
            DynamicGeometry.Settings.ScaleTextWithDrawing = savedScaleSetting;

            e.PageVisual = printCanvas;
        }