pictureEdit 可以直接绑定Image 或者 Byte Array (根据官方资料) 当我们在PictureEdit中放置一个较大图片的时候,SizeMode属性虽然设置Zoom 但还是会出现将图片容器趁的过大,从而影响下面的显示。 FileStream fs = new FileStream (fileName,FileModel.OpenOrCreate);
byte[] bt = new byte[fs.length]; fs.Close(); if(bt!=null) { Stream stream = new MemoryStream(bt); Bitmap bmtemp = new Bitmap(stream); Image img = new Bitmap(bmtemp, pictureEdid.With, pictureEdid.Height); //指定图片显示尺寸与控件大小一样 pictureEdid.EditValue = img; } |
|