Esempio n. 1
0
        public static swc.Image ToWpfImage(this Image image, float?scale = null, Size?fittingSize = null)
        {
            var source = image.ToWpf(scale, fittingSize);

            if (source == null)
            {
                return(null);
            }
            var swcImage = new swc.Image {
                Source = source
            };

            if (fittingSize != null)
            {
                swcImage.SetMaxSize(fittingSize.Value);
            }
            return(swcImage);
        }
Esempio n. 2
0
		public static swc.Image ToWpfImage(this Image image, float scale, Size? fittingSize = null)
		{
			var source = image.ToWpfScale(scale, fittingSize);
			if (source == null)
				return null;
			var swcImage = new swc.Image { Source = source };
			if (fittingSize != null)
			{
				swcImage.SetMaxSize(fittingSize.Value);
			}
			return swcImage;
		}