Search code examples
c#wpfimagemergeinkcanvas

WPF, C#, Ink Canvas, Image - How to save inkcanvas on existing image and save it as new image?


I'm trying to make a control where you can paint something on image and save that image with new staff.

At the moment I'm using Ink Canvas because it's really useful control, but I couldn't find how to merge it with background image. Moreover, I don't want InkCanvas to be dropped anywhere in image, I want it to be exactly in that place where it was painted.

Question: How to merge InkCanvas with image?

Current code:

<Grid>
            <Image x:Name="Image_Container"/>
            <InkCanvas Background="Transparent" IsEnabled="False" Width="Auto" Name="inkCanvas" />
</Grid>

Solution

  • <Canvas x:Name="editCanvas" Background="BlanchedAlmond" ClipToBounds="True"> <InkCanvas x:Name="inkCanvas"> <InkCanvas.Background> <ImageBrush Source="C:\Image.png"></ImageBrush> </InkCanvas.Background> </InkCanvas> </Canvas>