c# - How to Center Image in ViewBox -


i populating viewbox image, although cannot seem center on image. i've tried setting viewbox fill uniformtofill, centering image vertically , horizontally, etc , nothing seems work.

xaml

<stackpanel horizontalalignment="center" verticalalignment="center">     <viewbox maxwidth="500" maxheight="500" name="vb1">         <image x:name="myimage"/>     </viewbox>     </stackpanel> 

xaml.cs

bitmapimage bitimg = new bitmapimage(new uri("/mynewlink.jpg", urikind.relative)); myimage.source = bitimg imagesource; 

set verticalalignment , horizontalalignment of viewbox. have set content alignment of image.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -