我之前进行过搜索,我以为Canvas.SetLeft(image, double)
是答案,但它什么也没做
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(@"C:\Users\alu\Desktop\caballos_jpg\serie_2\02.jpg", UriKind.RelativeOrAbsolute);
myBitmapImage.EndInit();
imgCb01.Source = myBitmapImage;
Canvas.SetLeft(imgCb01, 152d);//This aint working
Canvas.SetTop(imgCb01, 285.0);//This aint working
Thickness margin = imgCb01.Margin;//I thought this lines would move my image
margin.Left = (imgCb01.Margin.Left) + 5;//slightly to the right
imgCb01.Margin = margin;//and they do but they are hiding (TT-TT) ...
所以我有这段代码,SetLeft
和SetTop
都不起作用,我想我可以做一些修改边距的技巧,但是当图像控件保持其位置时,图像会“前进”看起来图像刚刚变得不可见。
答案 0 :(得分:0)
好吧,我认为那只是来自Microsoft Visual Studio的一些奇怪的随机错误,我刚刚在另一台PC上再次开始复制XAML,它运行得很好……很抱歉打扰您:')