我想显示由两张图像组成的图像。如何将一幅图像叠加到另一幅图像上?
我想图像rectangle.png与它上面其左手在像素10角落图像sticker.png显示,10
这里是尽可能我得到了,但我该如何结合图像?
Image image = new Image();
image.Source = new BitmapImage(new Uri(@"c:\test\rectangle.png"));
image.Stretch = Stretch.None;
image.HorizontalAlignment = HorizontalAlignment.Left;
Image imageSticker = new Image();
imageSticker.Source = new BitmapImage(new Uri(@"c:\test\sticker.png"));
image.OverlayImage(imageSticker, 10, 10); //how to do this?
TheContent.Content = image;
非常好,这是我用过的方法,只需要添加一个imageSticker.VerticalAlignment = VerticalAlignment.Top; – 2010-03-19 17:25:12
这不是真正的叠加。如果我想在按钮上使用组合图像怎么办?这不会工作。 – bobbyalex 2011-09-05 12:08:01
为什么不呢? Button肯定可以将该网格作为其内容。 – 2011-09-07 17:52:27