Open wstaelens opened 3 years ago
Do you have a simple repro? Does adding the visual directly to the FixedPage
instead of rendering it on its DrawingContext
work for you? (I tried with an ellipse but it looked vector in a DocumentViewer
)
I don't have a separate solution with a small repro but the code already posted above shows the problem.
DrawingContextWrapper cntxt;
Visual visualToDraw;
// ...
var drawing = VisualTreeHelper.GetDrawing(visualToDraw); // <-- vector System.Windows.Media.ImageSource image = new DrawingImage(drawing); cntxt.Canvas.DrawImage(image, drawingBounds.ToRect()); // <-- raster
any updates?
🥱
XPS: When drawing a Visual on a DrawingContext of a FixedPage, the image is being rasterized and losing the Vector quality.
How to draw a Visual on a DrawingContext as a vector without it being rasterized (XPS)?
(found something related but not really the same: https://stackoverflow.com/questions/6490576/wpf-image-vector-format-export-xps/ )