Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop shadow causes clipping when saved to XPS #2047

Open
EmaginationStore opened this issue Oct 15, 2019 · 0 comments
Open

Drop shadow causes clipping when saved to XPS #2047

EmaginationStore opened this issue Oct 15, 2019 · 0 comments
Labels
Bug Product bug (most likely)
Milestone

Comments

@EmaginationStore
Copy link

  • .NET Core Version: 3.0
  • Windows version: Win 10 1903 (18362.239)
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
  • Is this bug related specifically to tooling in Visual Studio: No

Problem description:
I have a textblock with the built-in drop shadow effect. If the textblock is within a viewbox and the width and height of the window is around the size of the viewbox then the text is clipped when you save to XPS

Actual behavior:
Clipped XPS document

Expected behavior:
XPS document which represents the WPF visual

Minimal repro:
Xaml Window
<Window x:Class="XpsDropShadowCore.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:XpsDropShadowCore" mc:Ignorable="d" Title="MainWindow" Height="340" Width="600" MouseDoubleClick="MainWindow_OnMouseDoubleClick"> <Canvas Name="Canv"> <Viewbox StretchDirection="DownOnly" Width="580" Height="300" > <TextBlock FontSize="400" Foreground="BlueViolet" Text="Hello" > <TextBlock.Effect> <DropShadowEffect ShadowDepth="30"></DropShadowEffect> </TextBlock.Effect> </TextBlock> </Viewbox> </Canvas> </Window>
Window Code behind
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void MainWindow_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { var sfd = new SaveFileDialog { Filter = "XPS files (*.xps)|*.xps" }; if (sfd.ShowDialog() != true) return; var c = Canv; var doc = new XpsDocument(sfd.FileName, FileAccess.ReadWrite); var writer = XpsDocument.CreateXpsDocumentWriter(doc); writer.Write(c); doc.Close(); } }

@grubioe grubioe added the Bug Product bug (most likely) label Oct 16, 2019
@grubioe grubioe added this to the Future milestone Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Product bug (most likely)
Projects
None yet
Development

No branches or pull requests

2 participants