问题
I'm learning WPF at the moment.
I have a vector graphics canvas that I'd like to use as the background for a button, but I can't seem to find a way to do this in the documentation. I thought this would be an obvious thing to want to do.
Regards, Mark
回答1:
You can use a VisualBrush :
<Button Content="Hello">
<Button.Background>
<VisualBrush>
<VisualBrush.Visual>
<!-- Your vector graphics here -->
</VisualBrush.Visual>
</VisualBrush>
</Button.Background>
</Button>
回答2:
Apologies,
I think I've found the solution. DrawingBrush.
Thanks, Mark
来源:https://stackoverflow.com/questions/1026476/wpf-canvas-button