c# - WPF: How to make images scale together -
i dynamically adding images using view boxes uniformgrid
.
for (int = 0; < count; i++) { var viewbox = new viewbox(); var filepath = "myfilepath"; if (!file.exists(filepath)) continue; var newimage = new image(); var bitmapimage = new bitmapimage(new uri(filepath)); newimage.source = bitmapimage; viewbox.child = newimage; viewbox.setvalue(grid.rowproperty, i); imagegrid.children.add(viewbox); }
the problem i'm running images different sizes, horizontally or vertically.
a way visualize whats happening. if there's 2 images on screen, first image being wider , shorter second image. when shrink window horizontally, first image shrink independently same width second. now, when shrink window vertically, second image shrink independently until same height first.
how make 2 images scale without setting view box stretch property fill?
Comments
Post a Comment