0
votes

I want to save the image with InkCanvas stroke in a single image as like the below image. enter image description here

When I am using the RenderTargetBitmap the ink stroke disappeared and the path not saved.

How to save the image and ink stroke in a single image without using the CanvasDevice?

Thanks

1

1 Answers

1
votes

When I am using the RenderTargetBitmap the ink stroke disappeared and the path not saved.

According to the "XAML visuals and RenderTargetBitmap capture capabilities" of RenderTargetBitmap class:

Content that can't be captured will appear as blank in the captured image, but other content in the same visual tree can still be captured and will render (the presence of content that can't be captured won't invalidate the entire capture of that XAML composition).

So that the content of InkCanvas may not be captureable. And it seems like there is no APIs can directly capture a InkCanvas with an image attached.

How to save the image and ink stroke in a single image without using the CanvasDevice?

You should be able to use Win2D. I'm confused that why you don't want to use CanvasDevice, with Win2D to implement your feature is the recommend way to do this, I do recommend you to use that. For a code sample please reference this thread. If you have any issues when you using the Win2D package you may open new threads.