dotnet / dotnet/wpf

Drop shadow causes clipping when saved to XPS

Open
#2,047 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .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 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();
}
}`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.