Changeset 2177


Ignore:
Timestamp:
Dec 6, 2010, 1:42:13 PM (11 years ago)
Author:
kopal
Message:
  • printing now supports different dpi settings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/WorkspaceManager.cs

    r2176 r2177  
    235235            try
    236236            {
     237                Matrix m = PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice;
     238                double dx = m.M11 * 96;
     239                double dy = m.M22 * 96;
     240                this.GuiLogMessage("dx=" + dx + " dy=" + dy, NotificationLevel.Debug);
    237241                const int factor = 4;
    238242                ModifiedCanvas control = (ModifiedCanvas)((WorkSpaceEditorView)this.Presentation).ViewBox.Content;
     
    254258                    control.Arrange(new Rect(new System.Windows.Point(0, 0), control.DesiredSize));
    255259                    System.Windows.Size size = control.DesiredSize;
    256                    
    257                     RenderTargetBitmap bmp = new RenderTargetBitmap((int)size.Width * factor, (int)size.Height * factor, 96 * factor, 96 * factor, PixelFormats.Pbgra32);
     260
     261                    RenderTargetBitmap bmp = new RenderTargetBitmap((int)size.Width * factor, (int)size.Height * factor, dx * factor, dy * factor, PixelFormats.Pbgra32);
    258262                    bmp.Render(control);
    259263
Note: See TracChangeset for help on using the changeset viewer.