Windows Phone 7 Image Button

后端 未结 7 1798
抹茶落季
抹茶落季 2021-02-05 12:19

I need to create an Image Button for my application like web-oriented style. I have an image 20x20 pixel and want an image button with the same dimension of the image.

I

相关标签:
7条回答
  • 2021-02-05 12:53

    I don't see particular errors in your code but I don't have the tools right now to test it ans see why it fails.

    However you can create a VisualBrush with your image and use it as background for your Button:

    <Button>
        <Button.Background>
            <ImageBrush ImageSource="xyz.png"/>
        </Button.Background>
    </Button>
    

    Most Backgrounds are of type Brush, so you can use SolidColorBrush, LinearGradientBrush, ImageBrush, etc. You are not limited to colors.

    0 讨论(0)
提交回复
热议问题