Skip to content

[Question] [XPS] Drawing a Visual is always being rasterized #4466

Open
@wstaelens

Description

@wstaelens

XPS: When drawing a Visual on a DrawingContext of a FixedPage, the image is being rasterized and losing the Vector quality.

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

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/ )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions